Skip to content

Deprecate ActorNursery.run_in_actor() and offer as part of a new "high level" API: tractor.to_actor #290

@goodboy

Description

@goodboy

I've rambled on wayyy too long in #287 but thanks to attempts to
resolve that issue I think this is the way I'd like to go on a so
called one shot task per actor-style "worker pool" API.


Proposed re-factored "one-shot" style API

After (too) much thought about where/how this should be exposed,
i thankfully arrived at the right interface/naming, going with
the same API-naming/semantics as in all other libs:

So it's simple; we offer,

  • a new tractor.to_actor submod with equivalent convenience
    invocation fns,
    • .to_actor.run() to run an async def fn() as a one-off trio.Task
      in a single subactor.
    • .to_actor.run_sync() to run an def fn() sync fn equivalent?
      • not sure we really need this so might leave it as
        a follow-up.

TDLR justification and premises


ToDo

Metadata

Metadata

Assignees

No one assigned

    Labels

    apicancellationSC teardown semantics and anti-zombie semanticshelp wantedExtra attention is neededspawningof processes, (shm) threads, tasks on varied (OS-specific) backendssupervisiontesting

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions