jeff
03/14/2024, 4:09 PMApiStream
as a top-level variable, it is set up automatically. But is there a way to manually add one after startup, so that I can defer its initialization?David Herman
03/14/2024, 5:28 PMjeff
03/14/2024, 5:52 PMDavid Herman
03/14/2024, 6:10 PMjeff
03/14/2024, 6:19 PMApiStream
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)David Herman
03/14/2024, 7:01 PMApiStream
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.