Initializes a simple in-memory storage (based on TrieMap) with equal initial state for all sessions.
Initializes a simple in-memory storage (based on TrieMap) with equal initial state for all sessions.
Type of state
State factory
The state storage
Initializes a simple in-memory storage (based on TrieMap) with initial state based on deviceId
Initializes a simple in-memory storage (based on TrieMap) with initial state based on deviceId
case class MyState(deviceId: String, ...) StateStorage forDeviceId { deviceId => MyStorage.getStateByDeviceId(deviceId) map { case Some(state) => state case None => MyState(deviceId, ...) } }
Type of state
State factory
The state storage