Behavior of then() for a resolved promise?
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 42/100
Research direction
Start at the promise(val) resolution path and then(), then trace how Celery's EagerResult uses its already-fired on_ready promise. Define and verify the behavior for adding callbacks after resolution, including the callback chain and repeated resolution noted in the issue.
Written by the indexing model from the issue text.
Description
What's the expected behavior for calling then() on a resolved promise? Right now you add callbacks that will never get called.
E.g. using an EagerResult in celery you end up with something like this:
val = 40
result = EagerResult(val)
# Internally result.on_ready is a promise that has already fired, e.g. promise(val) is called.
result.then(callback, errback)
# Neither of these will ever fire.
I'd expect adding a callback to an already resolved promise to call it immediately.
Note that Twisted will immediately run your callbacks if a Deferred already has resolved, so I'm expecting the same behavior here.
(As an aside -- I find it odd you can resolve a promise multiple times...but it doesn't seem to have the same callback chain.)
- Dominant language
- Python
- Stars
- 129
- Forks
- 48
- Avg merge
- 13h 35m
- Merged PRs (30d)
- 4
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from celery/vine
-
ModernizationMay be free again @auvipy claimed this 609 days ago, and no pull request is open. Open
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
AI bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
AUTO-MAS-Project/AUTO-MAS#1960 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
btclib-org/btclib-wallet#872 ·
Maintainers usually reply within 1 day
-
[Bug]: Scheduled returns scan all accepted minion keys causing extreme loadPossibly taken A pull request linked to this issue is open or already merged. Openbug needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
saltstack/salt#70789 · 1 comment ·
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 87/100
btclib-org/btclib#3093 ·
Maintainers usually reply within 1 day