Conversation
simPod
force-pushed
the
fibers
branch
2 times, most recently
from
July 4, 2026 06:53
27769bd to
4598d41
Compare
simPod
force-pushed
the
cdn77
branch
2 times, most recently
from
August 17, 2026 09:24
468450d to
d8f145b
Compare
simPod
force-pushed
the
fibers
branch
3 times, most recently
from
August 19, 2026 07:33
726afa6 to
6cf5b91
Compare
Add a fiber-based AmpFutureAdapter and update DataLoader to dispatch, await, and resolve amphp/amp v3 futures. Preserve keyed and positional batch result handling, propagate throwables, and keep synchronous adapters unchanged.
Context: Amp futures require event-loop scheduling, explicit observation, and synchronous cancellation handling. Decision: add an optional async adapter interface and keep Amp scheduling, draining, observation, and cancellation inside the adapter. Consequences: DataLoader remains promise-library agnostic, and nested or concurrent waits settle without deadlocks.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Overblog\PromiseAdapter\Adapter\AmpFutureAdapter, a promise adapter backed by amphp/amp v3 fiber-basedAmp\Futures.dispatchQueueBatch()fans out viaAmp\async+Future::await(), staticawait()delegatesAmp\Futures to the adapter, andload()schedules batch dispatch on the next event-loop tick viaRevolt\EventLoop::queue()(mirroring the JS referenceprocess.nextTick).resolveDispatchedBatch()shared by both thethen()and fiber paths.Why
amp v3
Futures expose nothen()and only settle once the event loop advances, so the existingthen()-based DataLoader core could not be driven by them. This unblocks running the webonyxAmpFutureAdapterexecutor (amp v3) together with DataLoader batching.Validation
Proof-of-concept against webonyx
GraphQL::promiseToExecutewithAmpFutureAdapter, executed inside a root fiber:DataLoader::load()→ 1batchLoadFncall (batching confirmed).Impact
instanceof.amphp/ampis a dev/suggested dependency only.