romshark / webwire-go

A transport independent asynchronous duplex messaging library for Go
MIT License
216 stars 9 forks source link

Update session relevance #24

Closed KernelPryanic closed 6 years ago

KernelPryanic commented 6 years ago

Sessions must get a new field "lastUse" of date type to indicate when a particular session was lastly updated. This is important for the session manager to know whether a session is still relevant during garbage collection.

romshark commented 6 years ago

As of commit #cbd6017 a new LastLookup field is added to the webwire session object. It denotes the last time the session was looked up by the server and should prevent any session garbage collector from deleting active sessions.

Important Notes

When implementing the OnSessionLookup method of the SessionManager interface, the library user must now also permanently update the LastLookup field of the looked up session (if it's found) setting the current time. This is now mentioned in the documentation of this hook.