Cleanup threads
In the "cleanup" functions of this library (for example bracket functions), will the initialization, main work, and cleaning always happen in the same thread?
For some 3rd party libraries it is important to stay on the same thread.
Where exactly can the stream "move to a different thread", and even if this happens, would at least the "cleanup" happen on the original thread?
The initialization and cleanup happens in the same "Haskell thread", however haskell thread can be bound to a different OS thread at different times by the Haskell RTS. However it is possible to tell the RTS to not move the Haskell thread from one OS thread to another by using bound threads. See http://hackage.haskell.org/package/base-4.12.0.0/docs/Control-Concurrent.html#g:8 .
So the thread in which you are using the bracket combinator must a bound thread, depending on the situation either you can use something like runInBoundThread or if you want to ensure that all/some threads that streamly creates are bound threads then we can can provide a combinator that changes this behavior for a parituclar segment of the stream.