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

How to perform an imap call in a fiber iterator? #208

Open
JohnMerlino1 opened this issue Sep 18, 2016 · 1 comment
Open

How to perform an imap call in a fiber iterator? #208

JohnMerlino1 opened this issue Sep 18, 2016 · 1 comment

Comments

@JohnMerlino1
Copy link

JohnMerlino1 commented Sep 18, 2016

I am using the following:

require "em-synchrony"
require "em-synchrony/mysql2"
require "em-synchrony/activerecord"

I have three active_relation objects in an array:

   EM.synchrony do
     statuses = [
        User.very_frequent,
        User.frequent,
        User.infrequent
     ]
     ...

I then want to iterate through the collections and perform an imap call asynchronously using FiberIterator:

  EM::Synchrony::FiberIterator.new(statuses.size, @@pool_size).each do |i|
    status = statuses[i]
    status.each do |user|
      # imap stuff goes here
    end
  end
end

On the examples on the wiki and on the tests I saw, you use other asynchronous I/O such as TCP and HTTP. But is there an option for imap packed in this gem or another gem?

@dgutov
Copy link
Collaborator

dgutov commented Oct 24, 2016

Do you know an asynchronous IMAP library for Ruby?

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

No branches or pull requests

2 participants