I am trying to migrate from trio.BlockingTrioPortal to trio.from_thread(). Unfortunately I am running into some trouble because I am trying to call from a not-trio-created thread.
The documentation specifies that I can "pass a keyword argument, trio_token specifiying a specific trio.run loop to re-enter". But how do I get such a token? It doesn't seem mentioned anywhere else (including the description of trio.run).
I think I am looking for a function like trio.get_current_token() whose output I can save and pass to a thread for use with `trio.from_thread.run_sync.
The text was updated successfully, but these errors were encountered:
Yeah, a pointer would be great. I still feels somewhat counterintuitive that I have to fallback on trio.hazmat though, especially because with the old interface that wasn't necessary.
Hello,
I am trying to migrate from trio.BlockingTrioPortal to trio.from_thread(). Unfortunately I am running into some trouble because I am trying to call from a not-trio-created thread.
The documentation specifies that I can "pass a keyword argument, trio_token specifiying a specific trio.run loop to re-enter". But how do I get such a token? It doesn't seem mentioned anywhere else (including the description of trio.run).
I think I am looking for a function like
trio.get_current_token()whose output I can save and pass to a thread for use with `trio.from_thread.run_sync.The text was updated successfully, but these errors were encountered: