const classdraft::DraftSessionStore

sys::Obj
  concurrent::Actor
    draft::DraftSessionStore : wisp::WispSessionStore

DraftSessionStore is an in-memory WispSessionStore with optional support for serializing store to disk to maintatin session through reboots.

To use DraftSessionStore:

wisp := WispService
{
  ...
  it.sessionStore = DraftSessionStore(it)
  {
    it.expires  = 3hr
    it.storeDir = `/some/dir/`
  }
}
delete

Source

virtual override Void delete(Str id)

Delete any resources used by the given session id.

expires

Source

const Duration expires := 1day

Duration of sessions to live before they are automatically removed.

load

Source

virtual override Str:Obj? load(Str id)

Load the session map for the given id, or create a new one if not found.

make

Source

new make(WispService service, |This? f := null)

It-block constructor.

onStart

Source

virtual override Void onStart()

Callback when WispService is started.

onStop

Source

virtual override Void onStop()

Callback when WispService is stopped.

receive

Source

virtual override Obj? receive(Obj? obj)

save

Source

virtual override Void save(Str id, Str:Obj? data)

Save the given session map by session id.

service

Source

virtual const override WispService service

Parent WispService instance.

storeDir

Source

const File? storeDir

Optional directory to persist sessions between restarts, or do not persist sessions if null.