The approach I use in my projects it to combine Sequel's SQL
generation with the em-mysqlasyncapi:
EventedMysql.select( User.where(:age 10).limit(10).sql ) do |rows|
rows.each do |data|
user = User.load(data)
p user.age
end
end
You may be able to make this even
On Dec 7, 2:23 pm, Aman Gupta [EMAIL PROTECTED] wrote:
You may be able to make this even nicer:
class Sequel::MySQL::Dataset
def execute(sql)
EventedMysql.select(sql){|r| yield r}
end
end
User.where(:age 10).limit(10).each{|user| p user.age}
Not sure if that
On Nov 18, 2008, at 4:49 PM, Aman Gupta wrote:
In Eventmachine you would use EM::Deferrable for all of your Sequel
calls. EM would handle spawning any ruby threads (green threads in
MRI, native threads in JRuby). Then use #set_deferred_status in the
Deferrable to notify your business logic
On Thu, Nov 20, 2008 at 3:06 AM, Chuck Remes [EMAIL PROTECTED] wrote:
On Nov 18, 2008, at 4:49 PM, Aman Gupta wrote:
In Eventmachine you would use EM::Deferrable for all of your Sequel
calls. EM would handle spawning any ruby threads (green threads in
MRI, native threads in JRuby). Then
Forgive me if this is a naive question. I has noobie.
I'm developing a scalable distributed back end search system for a
client, and using eventmachine to great effect thus far. However, we
need database access, and that's where things start to get sticky.
I can use em-mysql and mysqlplus to
On Nov 18, 9:36 am, None [EMAIL PROTECTED] wrote:
Forgive me if this is a naive question. I has noobie.
I'm developing a scalable distributed back end search system for a
client, and using eventmachine to great effect thus far. However, we
need database access, and that's where things
On Nov 18, 2008, at 2:13 PM, Jeremy Evans wrote:
On Nov 18, 9:36 am, None [EMAIL PROTECTED] wrote:
Any ideas? Anyone else out there need anything like this?
Not really. If you can spawn threads to deal with the database
interactions, and just check those threads to see if they have
Deferrables would certainly help towards the goal of clean code using
one of the extant blocking ORMs (datamapper, activerecord, sequel),
but it doesn't actually satisfy the need for achieving parallelism
(see here for an excellent explanation of why:
It seems that the only real solution so far is roll your own.
Thanks for the help!
On Nov 18, 3:13 pm, Jeremy Evans [EMAIL PROTECTED] wrote:
On Nov 18, 9:36 am, None [EMAIL PROTECTED] wrote:
Forgive me if this is a naive question. I has noobie.
I'm developing a scalable distributed back
In Eventmachine you would use EM::Deferrable for all of your Sequel
calls. EM would handle spawning any ruby threads (green threads in
MRI, native threads in JRuby). Then use #set_deferred_status in the
Deferrable to notify your business logic when the Sequel calls have
completed.
You're
On Nov 18, 2:49 pm, Aman Gupta [EMAIL PROTECTED] wrote:
In Eventmachine you would use EM::Deferrable for all of your Sequel
calls. EM would handle spawning any ruby threads (green threads in
MRI, native threads in JRuby). Then use #set_deferred_status in the
Deferrable to notify your
11 matches
Mail list logo