-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Registering "foreign" threads #42
Comments
I don't think we can (or should) support using plain An Basically, your |
Yeah... Unfortunately, this is not like how it works in reality. Many, if not all, APIs |
I'm aware 😄 so let's see what's possible / what a good API could look like, and define the semantics of whatever the system provides. An example (from memory): withRunAsProcess :: (Process r a -> IO b) -> Process r c could allow for demo :: Process r Void
demo = withRunAsProcess $ \rap -> do
Server.run (rap . handleConnection)
where
handleConnection :: Connection -> Process r a
handleConnection conn = _ Here, the thread running However, this is likely not sufficient: since there's no way to share Thinking of it, monitoring won't really work since if I understand the problem you're facing and would be happy to collaborate in finding a suitable solution! |
As for I think the problem lies in |
I posted my sketch at #43. Not nearly a final proposal or anything like that (= |
I wrote some thoughts about |
I have an API that's using
forkIO
to e.g. handle client requests.How do I get back into
Process
context after being forked off the server loop?The unlift for readers is basically storing env and re-running with it again, but there's quite a bit of work in
spawnImpl
...In a nutshell,
If I pry open
Troupe.Process
a little and splitspawnImpl
atcurrentEnv <- getProcessEnv
, then it appears to work:But I don't know if some stuff should be masked or something like that.
The text was updated successfully, but these errors were encountered: