nicolasff / webdis

A Redis HTTP interface with JSON output
https://webd.is
BSD 2-Clause "Simplified" License
2.83k stars 304 forks source link

Fix subscribing over websockets #43

Closed jmorse closed 12 years ago

jmorse commented 12 years ago

Fix subscribe commands over websockets causing worker thread redis contexts being locked into subscribe mode.

This patch emulates functionality already in cmd_run, in the context of websockets. A client running "[P]SUBSCRIBE" will restrict the commands allowed to be issued in the context used. Therefore, websocket clients making subscriptions get their own context, so as to not pollute the workers' own Redis contexts.

Resource/context deallocation should occur upon http client disconnect, just as it is for client-specific contexts from cmd_run.

nicolasff commented 12 years ago

Great work Jeremy! Merged, thanks.