Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6049991
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:38:19+00:00 2026-05-23T07:38:19+00:00

I been Using EventMachine for quite a while a know and I really found

  • 0

I been Using EventMachine for quite a while a know and I really found it great as It Manage show much more me that i didn’t have to worry for anything.But recently I just found this weird issue which i just fail to understand

Here what is just telling

I have Eventmachine loop Which look like this

 EventMachine::run {     
    EventMachine::add_periodic_timer(10) do
         EventMachine::defer(@operation_block,@callback_block)
    end
 } 

here my operation block look like(Code below use of amqp using carrot gem)

@operation_block = Proc.new {
              begin   
              puts "Initiating the queue"
              @carrot ||= Carrot.new(:host => localhost)
              @queue ||= @carrot.queue("my_queue")
              puts "The Queue is Poping the message"

              if @queue.pop
                  [MY LOGIC HERE]
                  $input_to_callback = "SUCCESS" ## IF LOGIC GET EVALUATED WITHOUT ERROR ELSE WILL SET TO FAIL 
                else
                  $input_to_callback = "NOTHING TO PROCESSES"      
                end  
             rescue 
                puts e
                retry!   
             end    
             $input_to_callback 

          }

Here my callback block look like

@callback_block = Proc.new {|operation_block_output|
   if operation_block_output == "SUCCESS"
      puts "YAHOOOOOOOOO SUCCESS"
   elsif operation_block_output == "NOTHING TO PROCESSES"
      puts "BOO Nothing to processes"
   else  
      puts "FAIL ALARM"
   end      
 }

Now Here come the Trouble
The Code Though Work the way it should until something bad happen
Here what i meant

Now suppose I running this Above Code

I have a queue set name “my_queue” or it will create one if it doesn’t exists the queue is initially empty

here the output that I get on console

Initiating the queue

The Queue is Poping the Message

BOO Nothing to processes

As I message built the output Change in console accordingly based

Now the trouble

If I momentarily shutdown my AMQP server Here the output(to show what i meant)

Initiating the queue

Broken Pipe => Error That Caught in
begin rescue block in operation block

Now Start AMQP Server

The Code just never seem move ahead from line where it currently got error
that means I never Seem to print the line

The Queue is Poping the message

not only the current defer for which is retry happened but also the new defer operation block that get initiated after the Timer time just elapsed
i.e means of the subsequent call to operation block
never seem to move ahead and do processing and always print the following
output only

Initiating the queue

Just never seem to move ahead(stuck) and do Processing that it meant to i.e fetch the message from the queue do the processing accordingly and all the other stuff(as the AMQP server is running now)

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T07:38:19+00:00Added an answer on May 23, 2026 at 7:38 am

    Aman Gupta has replied for the question above
    https://github.com/eventmachine/eventmachine/issues/127#issuecomment-535210

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have been using CruiseControl for quite a while with NUnit and NAnt. For
Been using mod_python for a while, I read more and more articles about how
I've been using c++ 0x for a while now and have been very much
Been using PHP/MySQL for a little while now, and I'm wondering if there are
I've been using a lot of new .NET 3.5 features in the work that
I've been using PostgreSQL a little bit lately, and one of the things that
I've been using TortoiseSVN in a Windows environment for quite some time. It seems
Been using Javascript libraries like Prototype and jQuery for development, for a while now.
Been using PHP for quite some time now and I was wondering what this
I been using cmemcache + memcache for a while with positive results. However cmemcache

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.