Closed
Description
Currently, raw socket builders like
aSocket(ActorSelectorManager(Dispatchers.IO)).tcp().serverTransport(port = rawSocketPort)
are breaking structured concurrency since each socket creates a new stand-alone Job
, not connected to a parent coroutine. It causes problems when we need to automatically close a server socket on parent context failure or manual cancelation.
The solution is to add an optional parent scope parameter in one of the builders and possibly add an additional builder like CoroutineScope.aSocketInScope()
, which automatically uses parent socket.
Metadata
Metadata
Assignees
Labels
No labels