Skip to content

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

Description

@JohnMerlino1

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?

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions