Bug 9183 - C4::Search should only have one ZOOM event loop
Summary: C4::Search should only have one ZOOM event loop
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Jared Camins-Esakov
QA Contact: Jonathan Druart
URL:
Keywords:
Depends on:
Blocks: 9234 9239
  Show dependency treegraph
 
Reported: 2012-12-01 02:59 UTC by Jared Camins-Esakov
Modified: 2013-05-23 06:23 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Medium patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 9183: Refactor ZOOM event loop (22.45 KB, patch)
2012-12-01 04:09 UTC, Jared Camins-Esakov
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 9183: Refactor ZOOM event loop (22.50 KB, patch)
2012-12-07 14:18 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 9183: Refactor ZOOM event loop (22.56 KB, patch)
2012-12-26 14:41 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jared Camins-Esakov 2012-12-01 02:59:30 UTC
Right we we have three ZOOM event loops in C4::Search, which is rather wasteful and against good programming practice. I propose to use closures for the section of code that processes the actual results.
Comment 1 Jared Camins-Esakov 2012-12-01 04:09:02 UTC Comment hidden (obsolete)
Comment 2 Kyle M Hall 2012-12-07 14:18:08 UTC Comment hidden (obsolete)
Comment 3 Jonathan Druart 2012-12-26 14:41:09 UTC
QA Comments:

I don't know very well this part of code but it seems good to me.
I searched in the 2 places and I got results.

Marked as Passed QA.
Comment 4 Jonathan Druart 2012-12-26 14:41:28 UTC
Created attachment 14269 [details] [review]
Bug 9183: Refactor ZOOM event loop

Prior to this patch, there were three identical ZOOM event loops in
C4::Search. This is wasteful, and goes against all good programming
practice. This patch refactors the ZOOM event loops into a separate
subroutine which is called by SimpleSearch, searchResults, and
GetDistinctValues call.

The new routine, _ZOOM_event_loop process the ZOOM event loop and,
once it has been fully processed, passes control to a closure provided
by the calling routine for processing the results, and destroys the
result sets.

To test (after applying patch):
1) Do a regular bibliographic search that should return results.
2) Do a search in the Cataloging module that should return results.
3) If you get results from both searches, the patch works.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Comment 5 Jared Camins-Esakov 2012-12-27 15:09:48 UTC
This patch has been pushed to master.
Comment 6 Chris Cormack 2012-12-27 19:56:23 UTC
Pushed to 3.10.x will be in 3.10.2