Skip to content

Commit

Permalink
PR suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
ddelange committed May 21, 2021
1 parent e6911f1 commit 9f65c11
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 7 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,14 @@ seamlessly used inside of `asyncio` coroutines, without ever blocking
the event loop.


What's new
----------

`v2.0.0`

- Add support for universal pickling using [`dill`](https://github.com/uqfoundation/dill), installable with `pip install aioprocessing[dill]`. The library will now attempt to import [`multiprocess`](https://github.com/uqfoundation/multiprocess), falling back to stdlib `multiprocessing`. Force stdlib behaviour by setting a non-empty environment variable `AIOPROCESSING_DILL_DISABLED=1`. This can be used to avoid [errors](https://github.com/dano/aioprocessing/pull/36#discussion_r631178933) when attempting to combine `aioprocessing[dill]` with stdlib `multiprocessing` based objects like `concurrent.futures.ProcessPoolExecutor`.


How does it work?
-----------------

Expand Down
4 changes: 2 additions & 2 deletions aioprocessing/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
# is zero for an official release, positive for a development branch,
# or negative for a release candidate or beta (after the base version
# number has been incremented)
version = "1.2.0"
version_info = (1, 2, 0, 0)
version = "2.0.0"
version_info = (2, 0, 0, 0)

if hasattr(multiprocessing, "get_context"):

Expand Down
10 changes: 5 additions & 5 deletions aioprocessing/managers.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
import asyncio
from multiprocessing.util import register_after_fork
from queue import Queue

from aioprocessing.locks import _ContextManager
from .executor import _ExecutorMixin
from .mp import (
from threading import (
Barrier,
BoundedSemaphore,
Condition,
Event,
Lock,
RLock,
Semaphore,
managers as _managers,
)

from aioprocessing.locks import _ContextManager
from .executor import _ExecutorMixin
from .mp import managers as _managers


AioBaseQueueProxy = _managers.MakeProxyType(
"AioQueueProxy",
Expand Down
3 changes: 3 additions & 0 deletions aioprocessing/mp.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# flake8: noqa
import os
try:
if os.environ.get("AIOPROCESSING_DILL_DISABLED"):
raise ImportError
from multiprocess import *
from multiprocess import connection, managers, util
except ImportError:
Expand Down

0 comments on commit 9f65c11

Please sign in to comment.