https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17941

--- Comment #5 from Petter Goksøyr Åsen <[email protected]> ---
(In reply to Jonathan Druart from comment #4)

> No do not wait, release as soon as you can :)

OK, for the adventurous:
https://gist.github.com/boutros/c3a63904c788d0a6336023042ce22cde

We recently hired a very experienced Perl guy, so he's behind this, not me:)
But it's very simple actually: just by decorating subroutines with ":
PureFunction" - you get memoization for free!

The actuall PureFunctions module is maybe not for the faint of heart, but it's
very small, and I do belive it works out very beautifull. And as this is not a
persistent cache, but only valid during the scope of the request, we don't have
to deal with cache invalidation and such problems.

The solution can easily be extended to other Getter-methods, as long as they
are idempotent (which they should be).

-- 
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.
_______________________________________________
Koha-bugs mailing list
[email protected]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to