Commit graph

18 commits

Author SHA1 Message Date
Gered 0943e13f05 naming tweak 2022-01-05 17:00:49 -05:00
Gered 20b4067188 remove sweeper thread threshold stuff
i'm not totally convinced that it is that useful? i feel like just
making the sweeper thread run less frequently would solve most of the
same problems that the threshold was (possibly?) intended to solve?
2022-01-04 19:59:15 -05:00
Gered 52dd71f26b renaming on-expiry to on-removal
mainly because calling on-expiry for delete-session doesn't feel
appropriate if we're talking about an "expiration listener." calling
it a "removal listener" feels much better (especially now that we also
have a third argument containing the reason for removal, allowing
people to tell which is which).
2022-01-04 19:27:51 -05:00
Gered 8228408082 delete-session now also calls on-expiry when it deletes something 2022-01-04 19:20:17 -05:00
Gered 1384c52d75 on-expiry now also receives a "reason" parameter when called 2022-01-04 19:19:43 -05:00
Gered 01a7a379c6 add expiration listener support 2022-01-03 22:06:00 -05:00
Gered f71ca8985a rename 'memory' namespace to 'core' 2022-01-02 21:53:39 -05:00
Gered 69d5257e42 replace get-all-sessions with all-entries method added to AgingStore
seems like a slightly cleaner way to do this? maybe.
2022-01-02 21:50:34 -05:00
Gered c95a02270a somewhat silly convenience function for reading all session entries
most apps won't need to do this, but i seem to be unlucky and work on
apps that do care about this kind of thing ...
2022-01-02 19:42:55 -05:00
Gered baecdaf136 keep the sweeper thread inside MemoryAgingStore. add thread stop fn
this is a change for functionality that will almost never, ever be used
in practice. but i just didn't like the idea of the 'aging-memory-store'
function creating a thread that you then had no control over whatsoever
after it returns ... maybe someone, somewhere will benefit from this.
2022-01-02 19:41:02 -05:00
Gered f6aaf5e074 update tests again 2022-01-02 18:53:16 -05:00
Gered 70d301afb3 update tests 2022-01-02 18:30:21 -05:00
Gered a79fed3246 replace event functions with session expiry ttl, and tweak opts param
the events function stuff always seemed very overkill to me. i cannot
think of any other criteria i've ever wanted for session expiry other
than "expire based on some period of idle time elapsing" and an event
function being used to provide this seems a bit too much to me.

thusly, this has all been replaced with a simple ttl value (specified
in seconds) as a non-optional argument to aging-memory-store.

also change the aging-memory-store opts parameter, it must now be an
explicit map if provided
2022-01-02 15:53:43 -05:00
Gered 257c8caf10 update tests 2022-01-02 15:09:25 -05:00
Gered 1fd154c4f6 read-session should return nil when there is no value
this is to be consistent with most all other implementations of
ring's SessionStore that i've seen
2022-01-02 14:51:19 -05:00
Gered 3154ed7b38 add criterium benchmarks for future improvements/comparisons 2021-12-29 18:59:17 -05:00
Gered c35897b8c8 minor cleanups, mostly formatting 2021-12-29 17:54:43 -05:00
Gered 6b9e11880f initial commit. forking original from tag "0.3.1" by Kira Systems
https://github.com/kirasystems/aging-session
2021-12-29 17:22:01 -05:00