{{ message }}
Repository navigation
Replies: 2 comments
|
I'm not sure I gave enough detail to highlight why the default rails memoization is broken in Fibers. The flipper rack middleware sets # this is in the rack middleware, wrapping the request
> Flipper.memoize = true
=> true
> Flipper.memoizing?
=> true
# graphql kicks off execution, and simulating being in a fiber trying to do *any* memoization
> Fiber.new { Flipper.memoizing? }.resume
=> false |
0 replies
0 replies
Answer selected by
jakswa
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Ah, here is what I was missing:
graphql-rubyhas implemented a bridge across this gap, and copies Thread locals to Fibers upon creation:taken from https://github.com/rmosolgo/graphql-ruby/blob/5dcdb597c4dd9dc943b8a86f11c271a32d2a97a4/lib/graphql/dataloader.rb#L65-L77