Skip to content

Caller breaking changes: Only use name to access children.#204

Merged
fleming79 merged 9 commits intomainfrom
maintenance
Nov 18, 2025
Merged

Caller breaking changes: Only use name to access children.#204
fleming79 merged 9 commits intomainfrom
maintenance

Conversation

@fleming79
Copy link
Owner

@fleming79 fleming79 commented Nov 17, 2025

Previously 'name' could be used to lookup the Caller, however this could result in name clashes.
Now with the concept of children, we restrict the usage of name for lookup to children preventing unexpected results.

Other changes:

  • Caller.get() - now will always return a running caller, or raise an error if it isn't possible.
  • async with Caller('new') as caller: the the new syntax to start a new caller with a context`
  • Caller.get(name="MainThread") is now invalid. Use Caller.get("MainThread") instead.
  • Changed from classmethod to method
    • Caller.to_thread
    • Caller.to_thread_advanced
    • Caller.as_completed
    • Caller.wait_for

Name changes:

  • async_kernel.caller.Future -> async_kernel.pending.Pending
  • Caller.current_future -> Caller.current_pending
  • async_kernel.caller.FutureCancelledError -> async_kernel.pending.PendingCancelled

@fleming79 fleming79 changed the title Caller - instance checks names of children rather than all instances. Caller breaking changes: Allow duplicate name globally but unique children names Nov 18, 2025
@fleming79 fleming79 changed the title Caller breaking changes: Allow duplicate name globally but unique children names Caller breaking changes: Only use name to access children. Nov 18, 2025
@fleming79 fleming79 merged commit 87261c4 into main Nov 18, 2025
19 checks passed
@fleming79 fleming79 deleted the maintenance branch November 18, 2025 04:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant