Questions tagged [celluloid]

Actor-based concurrent object framework for Ruby

Celluloid is a concurrent object oriented programming framework for Ruby which lets you build multithreaded programs out of concurrent objects just as easily as you build sequential programs out of regular objects

99 questions
2
votes
1 answer

Maintaining state in distributed application

I am creating an asynchronous application using zeromq, celluloid. I need to maintain the states for different tasks that depend on some response. I can do it by sending data about the state in the response params. But is there any better way to do…
Pandurang Waghulde
  • 995
  • 1
  • 6
  • 19
2
votes
1 answer

Gracefully disconnect a WebSocket connection with Celluloid

Situation I connect to a WebSocket with Chrome's Remote Debugging Protocol, using a Rails application and a class that implements Celluloid, or more specifically, celluloid-websocket-client. The problem is that I don't know how to disconnect the…
slhck
  • 36,575
  • 28
  • 148
  • 201
2
votes
1 answer

Celluloid Pool has dead actors first time called

Everytime I launch the app, the first time I call it, it returns Dead Actors. After that it returns as expected. require 'celluloid' class BatchProcess include Celluloid POOL = BatchProcess.pool(size: 6) attr_accessor :base_url, :futures,…
pcasa
  • 3,710
  • 7
  • 39
  • 67
2
votes
2 answers

Why process blocked forever when call sleep in Celluloid::IO

I'm using Celluloid::IO to do DNS query and below is my code: require 'celluloid/io' class MyResolver include Celluloid::IO def initialize @resolver = DNSResolver.new end def resolve(domain) ips =…
akawhy
  • 1,558
  • 1
  • 11
  • 18
2
votes
0 answers

Jobs stopped in celluloid pool

Im need to retrieve data for account in parallel. I use celluloid for that my code class Daemon def self.start loop do Account.all.each do |acc| unless Celluloid::Actor[account.name] supervise_as(account.name,…
Leonko
  • 139
  • 1
  • 9
2
votes
2 answers

No live threads left. Deadlock?

I have a set of workers MessageConsumer, each with different responsibilities: HTTP calls, CRUD Mongo/Redis, API calls etc. They have the same structure: class MessageConsumer include Celluloid def perform(sqs_message) # Do something …
Pablo Cantero
  • 6,239
  • 4
  • 33
  • 44
2
votes
1 answer

Ruby's best way to process thousand async requests?

The task is to process quote ticks almost realtime ( 1 second delay ). At the moment I need to process about hundred quotes but it might increase to thousands. I'm looking at the EM currently to run ten threads each of which will run ten async…
nateless
  • 475
  • 6
  • 23
2
votes
1 answer

How do I run HTTP requests from a pool of threads using Celluloid?

I'm using Ruby 1.9.3, and testing it on Mac OSX 10.7. I have a Sender class which is supposed to send requests to some URL: require "celluloid" require "curb" class Sender include Celluloid def send(msg) Curl.get($URL) do |url| …
Eki Eqbal
  • 5,779
  • 9
  • 47
  • 81
2
votes
1 answer

Celluloid & performant HTTP requests

I try to switch an existing crawler from EventMachine to Celluloid. To get in touch with Celluloid I've generated a bunch of static files with 150 kB per file on a linux box which are served via Nginx. The code at the bottom should do its work, but…
ctp
  • 1,077
  • 1
  • 10
  • 28
2
votes
2 answers

Ruby Celluloid and resources consumption

I'm new to Celluloid and have some questions about pools and futures. I'm building a simple web crawler (see the example at bottom). My URLS array dozen of thousands of URLs, so the example is stripped to some hundred. What I now want to do is to…
ctp
  • 1,077
  • 1
  • 10
  • 28
1
vote
1 answer

Celluloid Animated Heatmap Issue with Axes and Missing Plots

I am trying to build an animated heatmap using celluloid. The x & y axis and color scale are the same but my code returns the weird output below. My code uses seaborn, numpy, pandas, and celluloid and is simplified below: from celluloid import…
Cody Glickman
  • 514
  • 1
  • 8
  • 30
1
vote
0 answers

RSpec expecting call to overridden method of Celluloid base class

When using RSpec to test class A that inherits another class B that inherits Celluloid, I am trying to set an expectation for a call of a method in class A that overrides its implementation on class B. Here's an example code: require…
roee
  • 859
  • 1
  • 7
  • 20
1
vote
0 answers

How to place a dynamic legend with matplotlib and celluloid

I am trying to simulate a motion of a particle with time stamp displayed as the particle moves. How do I place the time stamp/legend at a fixed location (say upper right corner)? This is what I have thus far: import numpy as np from matplotlib…
Laura
  • 1,383
  • 3
  • 9
  • 6
1
vote
1 answer

PubNub Ruby SDK: Celluloid::DeadActorError: attempted to call a dead actor: fetch_average

I'm trying to run a simple Ruby code using PubNub Ruby SDK 4.0.25, but when running ruby subscriber.rb I'm receiving in logs error shown below: # Logfile created on 2017-10-14 01:09:02 +0200 by logger.rb/56815 D, [2017-10-14T01:09:02.580516 #1990]…
dawlib
  • 237
  • 2
  • 13
1
vote
0 answers

Celluloid and ThreadError: can't create Thread: Resource temporarily unavailable

I'm running several workers that handle the work with Celluloid using mainly async. Some pieces of my code use also future or after. Everything works really good and fast but eventually the system starts to raise: ThreadError: can't create Thread:…
blanchma
  • 61
  • 3