Hi list,
I’ve been doing some playing with Fibers as a replacement of Thread
for usage in Ramaze, and as I’m not the most knowledgable about this
issue I’d like to request some code review from you guys.
The code in question with some simple usage is at:
http://p.ramaze.net/1618
I’m not sure if i would run into any issues with this approach or why
it hasn’t been done in the fiber library already, but would you see
this as a good use of fibers, to avoid having to pass state around for
every component in the application/framework?
My use case here is that you get a request from servers, possibly
event driven, which just doesn’t work well together with threading as
it’s done in ruby. So i take the request, create a couple of objects
and put them into the fiber instance, to be accessed by Fiber.current.
So it’s kind of a reimplementation of what Thread.current[:a] = 1
would do, but much more lightweight.
Thanks in advance, please let me know when you have any more questions
about this mail
^ manveru