Skip to content

non-blocking session provider #134

Open
@WyriHaximus

Description

@WyriHaximus

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:

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions