forked from goodboy/tractor
1
0
Fork 0
Commit Graph

565 Commits (a90a2b8787a57dfe192c1d9f97ab2c94a83f4fab)

Author SHA1 Message Date
Tyler Goodlet a90a2b8787 Contain the error 2021-02-21 14:08:23 -05:00
Tyler Goodlet da8c8c1773 Add concise readme example 2021-02-21 14:08:23 -05:00
Tyler Goodlet 57a24cdcf8 More comments 2021-02-21 14:08:23 -05:00
Tyler Goodlet 9b07e9ad7c Yield results on demand using a mem chan 2021-02-21 14:08:23 -05:00
Tyler Goodlet 3c320f467f Remove use of tractor.run() 2021-02-21 14:08:23 -05:00
Tyler Goodlet 2555765882 Make new paralellism example space 2021-02-21 14:08:23 -05:00
Tyler Goodlet 7db5739143 Add our version of the std lib's "worker pool"
This is a draft of the `tractor` way to implement the example from the
"processs pool" in the stdlib's `concurrent.futures` docs:

https://docs.python.org/3/library/concurrent.futures.html#processpoolexecutor-example

Our runtime is of course slower to startup but once up we of course get
the same performance, this confirms that we need to focus some effort
not on warm up and teardown times.  The mp forkserver method definitely
improves startup delay; rolling our own will likely be a good hot spot
to play with.

What's really nice is our implementation is done in approx 10th the code ;)

Also, do we want offer and interface that yields results as they arrive?

Relates to #175
2021-02-21 14:08:23 -05:00
Tyler Goodlet 7888ef6f01 Fix more stdlib typing issues with latest mypy 2021-02-21 12:48:03 -05:00
Tyler Goodlet 109066dda9 Support sync code breakpointing via built-in
Override `breakpoint()` for sync code making it work
properly with `trio` as per:

https://github.com/python-trio/trio/issues/1155#issuecomment-742964018

Relates to #193
2021-02-21 12:36:00 -05:00
goodboy d8b6c0093c
Merge pull request #188 from goodboy/we_aint_got_zombie_shields
We aint got zombie shields
2021-01-18 11:01:14 -05:00
goodboy 8fdab8e0be
Merge pull request #187 from goodboy/deprecate_rpcmodpaths
Begin rpc_module_paths deprecation
2021-01-14 18:28:16 -05:00
Tyler Goodlet 9f4e497b9c Don't shield proc waits 2021-01-14 18:21:26 -05:00
Tyler Goodlet 14d60147fa Add an example which breaks shielded proc waits 2021-01-14 18:21:26 -05:00
Tyler Goodlet e546ead2ff Pub sub internals type fixes 2021-01-14 18:20:59 -05:00
Tyler Goodlet 3df001f3a9 Fix msg pub global lock sharing
Using `None` as the default key for a `@msg.pub` can cause conflicts if
there is more then one "taskless" (no tasks={,} passed) pub offered on
an actor... So instead use the first trio "task name" (usually just the
function name) instead thus avoiding this very hard to debug and
understand problem.

Probably should throw in a test but I'm super lazy today.
2021-01-14 18:20:49 -05:00
Tyler Goodlet 5ed5d18ccb Begin rpc_module_paths deprecation 2021-01-08 22:08:45 -05:00
goodboy dfaf1e3631
Merge pull request #185 from goodboy/implicit_runtime
Implicit runtime
2021-01-08 22:07:43 -05:00
Tyler Goodlet 32b10681a1 Drop tractor.run() from @tractor_test 2021-01-08 20:56:03 -05:00
Tyler Goodlet 41a4de5af2 Use actual task name lel 2021-01-08 20:55:42 -05:00
Tyler Goodlet 59421d9f3a Fix some borked tests 2021-01-08 20:55:11 -05:00
Tyler Goodlet 333ddcf93f Can we ever really appease mypy? 2021-01-03 11:18:31 -05:00
Tyler Goodlet 0bb2163b0c Implicitly open root actor on first nursery use. 2021-01-02 21:39:30 -05:00
Tyler Goodlet bd3059f01b Allow for error bypass 2021-01-02 21:39:30 -05:00
Tyler Goodlet 803152ead5 Use explicit named args 2021-01-02 21:39:30 -05:00
Tyler Goodlet e6245671b0 Use runtime level on attach 2021-01-02 21:38:55 -05:00
goodboy bfe500060f
Merge pull request #181 from goodboy/drop_tractor_run
Deprecate `tractor.run()`
2020-12-28 12:53:04 -05:00
goodboy 3a5daa5b7a
Merge pull request #169 from goodboy/py3.9
Py3.9
2020-12-27 14:30:39 -05:00
Tyler Goodlet 723fb17394 Add deprecation warning to run() 2020-12-27 13:29:30 -05:00
Tyler Goodlet f05534e472 Re-org root actor startup into context manager
This begins the move to dropping support for `tractor.run()` which we
don't really need since the runtime is started (as it always has been)
from a new sub-task / nursery. Instead this introduces starting the
actor tree through a `open_root_actor()` async context manager which
we'll likely implicitly call (from the root) on the first use of an
actor nursery.

Drop `_actor._start_actor()` and factor its contents into this new api.
Make `run()` and `run_daemon()` use `open_root_actor()` until we decide
to remove them.

Relates to #168 and #177
2020-12-27 13:29:30 -05:00
Tyler Goodlet b040cdc0c9 Add null byte guard from mainline 2020-12-27 13:28:54 -05:00
Tyler Goodlet 02ac20a43c Include Python 3.9 in CI 2020-12-27 13:28:54 -05:00
goodboy f427c98cf6
Merge pull request #178 from goodboy/denoise_logging
Denoise logging
2020-12-27 13:10:17 -05:00
Tyler Goodlet 5127effd88 Drop warning level logging assert(s) 2020-12-26 15:45:55 -05:00
Tyler Goodlet 6b650c0fe6 Add a "runtime" log level 2020-12-26 15:45:45 -05:00
Tyler Goodlet 0d05a727b6 Use error log level by default 2020-12-25 15:28:32 -05:00
Tyler Goodlet c28ffd8b1c Don't exception log multi-cancels 2020-12-25 15:23:59 -05:00
Tyler Goodlet 5d7a4e2b12 Denoise some common teardown "errors" to warnings. 2020-12-25 15:10:20 -05:00
Tyler Goodlet 8522f90000 Add type annots to exceptions mod
Also add a `is_multi_cancelled()` predicate to test for
`trio.MultiError`s that contain entirely cancel signals.

Resolves #125
2020-12-25 15:07:36 -05:00
goodboy f4f39c29f3
Merge pull request #174 from goodboy/func_refs_always
Allow passing function refs to `Portal.run()`
2020-12-22 19:45:10 -05:00
Tyler Goodlet 4bf9b27f57 Drop all .statespace refs; it was a silly idea 2020-12-22 19:33:16 -05:00
Tyler Goodlet 0eba5f4708 Port remaining tests to pass func refs 2020-12-22 10:39:47 -05:00
Tyler Goodlet 493f2efb50 Port tests to `Portal.run_from_ns()` 2020-12-22 10:39:47 -05:00
Tyler Goodlet 9fd3c42eb1 Port inter-process method calls to `Portal.run_from_ns()` 2020-12-22 10:39:47 -05:00
Tyler Goodlet 7134f35d6e Add `Portal.run_from_ns()`
It turns out in order to maintain our sneaky little "call an `Actor`
method in this remote process" we still need the ability to invoke
functions from a namespace. We're currently using a "self" namespace as
a way to do this for internal inter-process method calling.  Either way,
I see no reason not to keep a public method for this invoke style (we
just won't market it) since it is still how the machinery works
underneath.
2020-12-22 10:39:47 -05:00
Tyler Goodlet a668f714d5 Allow passing function refs to `Portal.run()`
This resolves and completes #69 allowing all RPC invocation APIs to pass
function references directly instead of explicit `str` names for the
target namespace and function (this is still done implicitly
underneath).  This brings us closer to `trio`'s task running API as well
as acknowledges that any inter-host RPC system (and API) will likely
need to be implemented on top of local RPC primitives anyway. Even if
this ends up **not** being true we can always go to "function stubs" as
part of our IAC protocol or, add a new method to do explicit namespace
calls: `.run_from_module()` or whatever everyone votes on.

Resolves #69

Further, this commit drops `Actor.statespace` from the entire system
since a user can easily get this same functionality using module
level variables. Fix docs to match all these changes (luckily mostly
already done due to example scripts referencing).
2020-12-21 09:09:55 -05:00
goodboy c3b209fa4f
Merge pull request #173 from goodboy/fix_debug_tests_in_ci_again
Fix debug tests in ci again
2020-12-19 00:06:29 -05:00
Tyler Goodlet dc475b54ab More obnoxious CI timeout handling 2020-12-18 19:26:29 -05:00
Tyler Goodlet 0d67ce4abc Fix collections type import for py3.10 2020-12-18 17:58:07 -05:00
Tyler Goodlet a95488ad2f Handle pexpect's internal timeout 2020-12-18 17:57:44 -05:00
goodboy 1701493087
Merge pull request #171 from goodboy/stream_channel_shield
Add a way to shield a stream's underlying channel
2020-12-18 11:17:08 -05:00