-
|
We’re currently using an embedded AnyCable server to do our own bookkeeping of connections in Redis and ideally we’d be able to pass extra state (a string ID) from Rails to the server. Is there a recommended way to do this? It looks like the connection from the Rails side does have state that can be populated but we can’t seem to easily fetch that on the server side using embedding. As it is, we’re looking at making our own separate RPC calls from the server side but that has complications as we can’t easily share the barrier used by AnyCable’s own RPC client to throttle concurrency as it is private state. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
|
Hey @mudge,
Do you mean a custom Go app with the anycable-go embedded or smth else? If it's a go app, check out our Twilio example: you can use a custom executor (that wraps the default node.Node) and implement a custom logic on top of it (see ReadInternalState): https://github.com/anycable/twilio-ai-demo/blob/487ca2dff533e2c54402388a4356eacd7bc96186/cable/pkg/twilio/executor.go#L268 |
Beta Was this translation helpful? Give feedback.
Oh, I see. The SSEHandler is not really extensible at the moment.
I think, in your case, having a custom controller (a wrapper over the default one) could do the trick.
Smth like that in the options for the AnyCable runner: