@@ -21,6 +21,14 @@ Features
21
21
`~trio.abc.ReceiveStream.receive_some `; you can ``await
22
22
stream.receive_some() `` with no arguments, and the stream will
23
23
automatically pick a reasonable size for you. (`#959 <https://github.com/python-trio/trio/issues/959 >`__)
24
+ - Threading interfaces have been reworked:
25
+ ``run_sync_in_worker_thread `` is now `trio.to_thread.run_sync `, and
26
+ instead of ``BlockingTrioPortal ``, use `trio.from_thread.run ` and
27
+ `trio.from_thread.run_sync `. What's neat about this is that these
28
+ cooperate, so if you're in a thread created by `to_thread.run_sync `,
29
+ it remembers which Trio created it, and you can call
30
+ ``trio.from_thread.* `` directly without having to pass around a
31
+ ``BlockingTrioPortal `` object everywhere. (`#810 <https://github.com/python-trio/trio/issues/810 >`__)
24
32
- We cleaned up the distinction between the "abstract channel interface"
25
33
and the "memory channel" concrete implementation.
26
34
`trio.abc.SendChannel ` and `trio.abc.ReceiveChannel ` have been slimmed
@@ -86,11 +94,15 @@ Deprecations and Removals
86
94
~~~~~~~~~~~~~~~~~~~~~~~~~
87
95
88
96
- The ``clear `` method on `trio.Event ` has been deprecated. (`#637 <https://github.com/python-trio/trio/issues/637 >`__)
89
- - ``run_sync_in_worker_thread `` has become `trio.to_thread.run_sync `, in
90
- order to make it shorter, and more consistent with the new
91
- ``trio.from_thread ``. And ``current_default_worker_thread_limiter `` is
92
- now `trio.to_thread.current_default_thread_limiter `. (Of course the
93
- old names still work with a deprecation warning, for now.) (`#810 <https://github.com/python-trio/trio/issues/810 >`__)
97
+ - ``BlockingTrioPortal `` has been deprecated in favor of the new
98
+ `trio.from_thread `. (`#810
99
+ <https://github.com/python-trio/trio/issues/810> `__)
100
+ - ``run_sync_in_worker_thread `` is deprecated in favor of
101
+ `trio.to_thread.run_sync `. (`#810
102
+ <https://github.com/python-trio/trio/issues/810> `__)
103
+ - ``current_default_worker_thread_limiter `` is deprecated in favor of
104
+ `trio.to_thread.current_default_thread_limiter `. (`#810
105
+ <https://github.com/python-trio/trio/issues/810> `__)
94
106
- Give up on trying to have different low-level waiting APIs on Unix and
95
107
Windows. All platforms now have `trio.hazmat.wait_readable `,
96
108
`trio.hazmat.wait_writable `, and `trio.hazmat.notify_closing `. The old
0 commit comments