Example redis call inside receive_data
Opened this issue · 1 comments
Deleted user commented
Could you provide an example how I should use synchrony when calling redis.set(key, value) inside EM's receive_data? I'm getting: synchrony.rb:81:in `yield': can't yield from root fiber (FiberError). How should I use a Fiber?
igrigorik commented
You would have to wrap all the code inside the receive_data function in a fiber context - e.g. use a fiber tool, or spawn a new fiber.
def receive_data(data)
Fiber.new {...}.resume
end