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

Handle exceptions and preserve function type. #11

Merged
merged 12 commits into from
Oct 16, 2023

Conversation

aebrahim
Copy link
Member

We add explicit exception handling, and the decorated function now will look like the original function to inspect (for example, an async function will have inspect.iscoroutinefunction evaluate to True.

We add explicit exception handling, and the decorated function now will
look like the original function to inspect (for example, an async
function will have inspect.iscoroutinefunction evaluate to True.

This makes significant progress towards DelfinaCare#12.
@aebrahim aebrahim force-pushed the polish branch 3 times, most recently from 128d6db to 6462ca7 Compare October 12, 2023 05:29
Copy link

@floan floan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is essentially a new language to me, I feel severely under-qualified to review this, but I do have questions!

once/__init__.py Outdated Show resolved Hide resolved
once/__init__.py Outdated Show resolved Hide resolved
once/__init__.py Show resolved Hide resolved
once/__init__.py Show resolved Hide resolved
@aebrahim
Copy link
Member Author

This is essentially a new language to me, I feel severely under-qualified to review this, but I do have questions!

:P Matt and I thought you'd find this interesting! He will review it too, don't worry.

@floan
Copy link

floan commented Oct 12, 2023

:P Matt and I thought you'd find this interesting!

I do! Thanks for tagging me in the review! I'm sure I will have more follow ups the more I study coroutines 😁

It now re-uses the logic we have already implemented in _OnceBase to
avoid re-inventing the wheel.
once/__init__.py Show resolved Hide resolved
once/__init__.py Outdated Show resolved Hide resolved
once/__init__.py Outdated Show resolved Hide resolved
once/__init__.py Outdated Show resolved Hide resolved
once/_iterator_wrappers.py Show resolved Hide resolved
once/_iterator_wrappers.py Outdated Show resolved Hide resolved
Trying to release the lock during function execution was not worth the
increased complexity, because subsequent calls would be blocked anyways
on waiting for execution, so they may as well be blocked by the lock.
The new code is simple enough that we can have _callable directly create
self-contained functions without it getting too long.
once/_iterator_wrappers.py Show resolved Hide resolved
once_test.py Show resolved Hide resolved
once_test.py Outdated Show resolved Hide resolved
once_test.py Show resolved Hide resolved
once_test.py Outdated Show resolved Hide resolved
once_test.py Show resolved Hide resolved
once_test.py Show resolved Hide resolved
once_test.py Outdated Show resolved Hide resolved
once_test.py Outdated Show resolved Hide resolved
Also, add documentation for iterator behavior.
This lets us ensure parallel function test calls execute in parallel.
once_test.py Show resolved Hide resolved
once_test.py Outdated Show resolved Hide resolved
once_test.py Show resolved Hide resolved
@aebrahim aebrahim merged commit 07118b2 into DelfinaCare:main Oct 16, 2023
45 checks passed
@aebrahim aebrahim deleted the polish branch October 16, 2023 18:50
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.

3 participants