Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eventmachine support #66

Open
treeder opened this issue Apr 10, 2011 · 1 comment
Open

Eventmachine support #66

treeder opened this issue Apr 10, 2011 · 1 comment
Assignees

Comments

@treeder
Copy link
Member

treeder commented Apr 10, 2011

The following use cases could/should be supported in the end:

Synchronous, like it is now, eg:

results = @sdb.select("select * from sdb")
results.each do |r|
    # do something
end

EM async, eg:

@sdb.select("select * from sdb") do |results|
  results.each do |r|
      # do something
  end
end

Concur style, eg:

results_future = executor.execute do 
  @sdb.select("select * from sdb")
end
# at some point when the results are needed
results = results_future.get
results.each do |r|
  # do something
end

OR another concur style, initializing with executor

@sdb = Aws::SdbInterface.new(TestCredentials.aws_access_key_id, TestCredentials.aws_secret_access_key, :executor=>executor)

then:

results_future = @sdb.select("select * from sdb")
# at some point when the results are needed
results = results_future.get
results.each do |r|
  # do something
end

OR to mix sync with async:

results_future = @sdb.select("select * from sdb", :executor=>executor)
@ghost ghost assigned rkononov Apr 10, 2011
@treeder
Copy link
Member Author

treeder commented Apr 20, 2011

@rkononov I just pushed some changes where I'm trying to use a second EventMachine adapter using concur. See test_performance.rb for usage, but the idea is to be able to queue up a bunch of requests using the concur executor pattern and then get the results from the futures so it's not so callback spaghetti'ish (to the user at least), it's definitely spaghetti going on behind the scenes right now though ;). You'll need to get the latest concur code and build/install the gem to get it working.

I think it's close, but not quite there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants