Closed syrusakbary closed 7 years ago
Is this still the recommended way to use gevent
with DataLoader
? I can't find any documentation on that, but with the code shown above I get
GeventScheduler.call() missing 1 required positional argument
on all requests.
This PR refactors the schedulers so it's easy to plug different instances, and removes the unnecessary abstraction
Context
.Also, by default the event loop is deactivated (trampoline is disabled, so the promise resolution go directly to the scheduler). Available schedulers:
promise.schedulers.ImmediateScheduler
: executes as soon as is called, good for testing or environments without event loop.promise.schedulers.AsyncioScheduler
: scheduler using the asyncio event looppromise.schedulers.GeventScheduler
: scheduler using the gevent event loopHow to use a custom scheduler?
Also, the dataloader will use the default scheduler for loading.
@phil303
Related issue: https://github.com/graphql-python/graphene/issues/488