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 8156089
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T16:50:56+00:00 2026-06-06T16:50:56+00:00

I have simple script with EventMachine, Fibers and faye require faye require em-synchrony require

  • 0

I have simple script with EventMachine, Fibers and faye

require "faye"
require "em-synchrony"
require "hiredis"
require 'redis'
require 'redis/connection/synchrony'

faye = Faye::Client.new 'http://localhost:9292/faye'
redis = Redis.new

EM.synchrony do

  faye.subscribe('/event_1') do |message|
    Fiber.new do
      puts "Event 1 start"
      user_id = redis.hget 'myhash', message.client_id
      puts "Event 1 finish"
    end.resume
  end 

  faye.subscribe('/event_2') do |message|
    Fiber.new do
      puts "Event 2 start"
      user_id = redis.hget 'myhash', message.client_id
      puts "Event 2 finish"
     end.resume
  end # subscribe

end #EM.synchrony

event_1 comes first, event_2 next to it (very small interval)
When i run it and event’s fired. I always have this output:

Event 1 start
Event 2 start
Event 2 finish

Thats all.
Where is Event 1 finish?
What i’m doing wrong?

UPD: If i remove asynchrones removing require 'redis/connection/synchrony' all works great. But i need this asynchrones.

ruby-1.9.2-p290 [ x86_64 ]

  • 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-06-06T16:50:57+00:00Added an answer on June 6, 2026 at 4:50 pm

    The answer was to use Synchrony ConnectionPool.

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

Sidebar

Related Questions

OK I have a simple script at http://kleague.org/test/ Type a movie name and it
I have a simple script that closes a DIV. An example is here: http://jsfiddle.net/22fTm/3/
Hi I have simple split script and I am splitting a string on new
I have this simple script: ids=22656 url = http://api.stackoverflow.com/1.0/users/+ids+/timeline; console.log( url ); xmlhttp =
I have this simple script : var exec = require('child_process').exec; exec('coffee -cw my_file.coffee', function(error,
I have a simple script that does some search and replace. This is basically
I have a simple script that pulls about 100 million results, 1 million at
I have simple table creating script in Postgres 9.1. I need it to create
I have a simple php script on my domain that sends me an email:
I have a simple Python script that uses the socket module to send a

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.