Skip to content
Playground(another site)

bynk.deploy.multiple_websocket_members

Error More than one member of a [deploy.workers.<key>] group declares a from websocket service; an upgrade request names no path or service a group could route it by, so a group has at most one such member, which takes every upgrade request whatever the path.

A WebSocket upgrade request names no service, and a from websocket service has no path of its own, so a Worker hands every upgrade to its one WebSocket service. A [deploy.workers.<key>] group folds its members into one Worker, so at most one member may declare a from websocket service, and that one takes every upgrade, whatever its path. Put the contexts in different groups, or leave one in no group so that it is a Worker of its own. Within one context, a second WebSocket service is bynk.service.websocket_multiple.

Example

bynk.toml
[deploy.workers.live]
contexts = ["live.chat", "live.scores"]
// live/chat.bynk
service chat from websocket(in: Frame, out: Frame) { … }
// live/scores.bynk
context live.scores // ✗ the second member of `live` with a WebSocket service
service scores from websocket(in: Frame, out: Frame) { … }
// bynk.toml
contexts = ["live.chat"] // ✓ `live.scores` is a Worker of its own

In the Book

See also

  • Every code in its category, Deployment, on the diagnostic index.
  • bynk explain bynk.deploy.multiple_websocket_members shows the same from the installed toolchain, without a network.