Edit: Ignore my previous messages, I think I figured out my issue. Will update if not
d
David Herman
03/14/2024, 6:10 PM
No worries, good luck!
j
jeff
03/14/2024, 6:19 PM
tldr: not urgent
I corrected some flawed assumptions, but didn't quite figure this out specifically. On the client,
ApiStream
has a
.connect()
method to allow you to connect it whenever you want.
But on the server, I see only the 'magic' that happens when you declare it as a top-level with
@Api
.
I'm still curious if there's a way to defer ApiStreams on the server, although I'm thinking it might make more sense in my particular case to set them up immediately and then defer the code that actually sends anything to them (so that I won't drop connections that come in too fast)
d
David Herman
03/14/2024, 7:01 PM
The
ApiStream
object on the server is very lightweight. You should think of it like
Api
methods actually -- once registered, they're always there, waiting to respond to client messages.