Skip to content

Commit

Permalink
Add note about rails isolation_level
Browse files Browse the repository at this point in the history
  • Loading branch information
rmosolgo committed Dec 18, 2023
1 parent 8270480 commit eea7871
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion guides/dataloader/async_dataloader.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,17 @@ __Also__, add [the `async` gem](https://github.com/socketry/async) to your proje
bundle add async
```

That's it! Now, {{ "GraphQL::Dataloader::AsyncDataloader" | api_doc }} will create `Async::Task` instances instead of plain `Fiber`s and the `async` gem will manage parallelism.
Now, {{ "GraphQL::Dataloader::AsyncDataloader" | api_doc }} will create `Async::Task` instances instead of plain `Fiber`s and the `async` gem will manage parallelism.

For a demonstration of this behavior, see: [https://github.com/rmosolgo/rails-graphql-async-demo](https://github.com/rmosolgo/rails-graphql-async-demo)

## Rails

For Rails, you'll also want to configure Rails to use Fibers for isolation:

```ruby
class Application < Rails::Application
# ...
config.active_support.isolation_level = :fiber
end
```

0 comments on commit eea7871

Please sign in to comment.