dox_websocket 1.0.0-beta.1 copy "dox_websocket: ^1.0.0-beta.1" to clipboard
dox_websocket: ^1.0.0-beta.1 copied to clipboard

Websocket library for dox framework.



Dox Websocket #

Websocket library for dox framework.

Features #

  • Support redis driver

Usage #

  • Create a service
class WebsocketService implements DoxService {
  @override
  setup() {
    DoxWebsocket websocket = DoxWebsocket();

    Redis sub = Redis();
    Redis pub = sub.duplicate();

    websocket.adapter(
      WebsocketRedisAdapter(subscriber: sub, publisher: pub),
    );

    Dox().setWebsocket(websocket);
  }
}
  • Register in dox
Dox().initialize(config);
Dox().addService(WebsocketService());
await Dox().startServer();

Note #

  • If you are not using redis adapter, websocket do not support with multiple isolate. You will need to set to single isolate.
Dox().totalIsolate(1);
1
likes
0
points
19
downloads

Publisher

verified publisherdartondox.dev

Weekly Downloads

Websocket library for dox framework.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

dox_annotation, ioredis, uuid

More

Packages that depend on dox_websocket