Remix.run Logo
kentonv 3 days ago

> Is there a structured concurrency library being used to manage the chained promise calls

Cap'n Web has no dependencies at all. All the chaining is implemented internally. Arguably, this is the main thing the library does; without promise chaining you could cut out more than half the code.

> If an await call is never added, would function calls continue to build up taking up more and more memory

Yes. I recommend implementing rate limits and/or per-session limits on expensive operations. This isn't something the library can do automatically since it has no real idea how expensive each thing is. Note you can detect when the client has released things by putting disposers on your return values, so you can keep count of the resources the client is holding.