Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spawn backend table #335

Merged
merged 11 commits into from
Oct 10, 2022
Merged

Spawn backend table #335

merged 11 commits into from
Oct 10, 2022

Conversation

goodboy
Copy link
Owner

@goodboy goodboy commented Oct 9, 2022

Prep for more spawning backends (such as rsyscall as per #272).

The explicit set of backends is now: ['trio', 'mp_spawn', 'mp_forkserver'] as can be set by tractor._spawn.try_set_spawn_method().

Further this patch set also,

  • fixes/updates some type annotations that seem to be failing on latest mypy
  • drops the tractor.testing subpkg and moves our @tractor_test definition into tests/conftest.py
  • changes the ci.yml to explicitly run the tests on each spawning backend

@goodboy goodboy requested a review from guilledk October 9, 2022 20:28
@goodboy goodboy force-pushed the spawn_backend_table branch from e8e1028 to c261d8a Compare October 9, 2022 20:46
Instead of the logic branching create a table `._spawn._methods`
which is used to lookup the desired backend framework (in this case
still only one of `multiprocessing` or `trio`) and make the top level
`.new_proc()` do the lookup and any common logic. Use a `typing.Literal`
to define the lookup table's key set.

Repair and ignore a bunch of type-annot related stuff todo with `mypy`
updates and backend-specific process typing.
@goodboy goodboy force-pushed the spawn_backend_table branch from c261d8a to 90f4912 Compare October 9, 2022 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant