Skip to content

Commit

Permalink
Remove 'event-like' as a type (#405)
Browse files Browse the repository at this point in the history
* Remove 'event-like' as a type

* Use class references
  • Loading branch information
mdickinson committed Jul 12, 2021
1 parent 048be2e commit 8a03b40
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
6 changes: 3 additions & 3 deletions traits_futures/i_parallel_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ def event(self):
Returns
-------
event : event-like
event : object
An event that can be shared safely with workers.
The event should have the same API as ``threading.Event``
and ``multiprocessing.Event``, providing at a minimum
The event should have the same API as :class:`threading.Event`
and :class:`multiprocessing.Event`, providing at a minimum
the ``set`` and ``is_set`` methods from that API.
"""

Expand Down
5 changes: 4 additions & 1 deletion traits_futures/multiprocessing_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,11 @@ def event(self):
Returns
-------
event : event-like
event : object
An event that can be shared safely with workers.
The event should have the same API as :class:`threading.Event`
and :class:`multiprocessing.Event`, providing at a minimum
the ``set`` and ``is_set`` methods from that API.
"""
return self._manager.Event()

Expand Down
5 changes: 4 additions & 1 deletion traits_futures/multithreading_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,11 @@ def event(self):
Returns
-------
event : event-like
event : object
An event that can be shared safely with workers.
The event should have the same API as :class:`threading.Event`
and :class:`multiprocessing.Event`, providing at a minimum
the ``set`` and ``is_set`` methods from that API.
"""
return threading.Event()

Expand Down

0 comments on commit 8a03b40

Please sign in to comment.