Skip to content
This repository was archived by the owner on Dec 7, 2018. It is now read-only.
This repository was archived by the owner on Dec 7, 2018. It is now read-only.

Using it in forked / multithreaded env #103

@doits

Description

@doits

I'm trying to use DCell in my rails app like the following:

# initializer
DCell.start id: 'sender', addr: 'tcp://127.0.0.1:9002'

# controller
...
def index
  DCell::Node['client'][:xmpp].send_message 'something'
end

The node client is existing and implements the actor :xmpp which has the method send_message. When I start Rails in development mode (unicorn webserver), everything works. DCell connects to the client and calls the method send_message on the existing actor :xmpp.

But when I use passenger as a web server, the line DCell::Node['client'][:xmpp].send_message 'something' hangs forever. In the client node I do not get any connection attempt (... Connected to sender). I think this might be because passenger is using multiple threads and forking. Is there any solution to this? How to use DCell in a multithreaded environment?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions