Open
Description
Currently the session provider reads out session data in a blocking way. This is okey but not an option if we want to go for a full non-blocking websocket server. Creating an deferrable interface would allow for predis async to be used as well as still supporting sf2 sessions within a wrapper. It would make the plain sf2 sessions a bit more complicated but allows more adapters then just predis. Below is some pseudo code how it could be done.
interface {
readSession(sessionId);
}
concrete class {
readSession(sessionId) {
promise = new promise;
this->client->get(sessionId, promise);
return promise;
}
}
Another thing is should the onOpen call wait for the session to be retrieved or fire anyway and fire another call for the session data?
Possible adapters:
- PredisAsync
- MySQL
- Blocking adapter running in a seperrate process made possible by:
- 0MQ
- ChildProcess
Activity