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
3
votes
0 answers

Getting Error "LoadError: cannot load such file -- celluloid/current" while running rake db:create on ubuntu 20.04

I am trying to setup new project which is in rails 6. When I am trying to create DB by running rake db:create, it gives me below error. Here is the complete trace. rake aborted! LoadError: cannot load such file --…
Rakesh
  • 793
  • 4
  • 22
3
votes
1 answer

Delay in processing more requests/sec

I have a JRuby application using celluloid. It receives requests through Zeromq socket and responds with JSON string. So, There are 2 actors in my application one for processing requests and another for sending a response(Push socket in…
Pandurang Waghulde
  • 995
  • 1
  • 6
  • 19
3
votes
1 answer

Accessing mailbox for actor initialised through pool in Celluloid

I have 2 actors in my app. Service and PushSocket. I am using mailbox for communication between two actors Service and PushSocket. It works well when I just create single instance on PushSocket and add message to it's mailbox. **File:…
Pandurang Waghulde
  • 995
  • 1
  • 6
  • 19
3
votes
1 answer

Running code asynchronously inside pollers

In my ruby script,I am using celluloid-zmq gem. where I am trying to run evaluate_response asynchronously inside pollers using, async.evaluate_response(socket.read_multipart) But if I remove sleep from loop, somehow thats not working out, It is…
Pandurang Waghulde
  • 995
  • 1
  • 6
  • 19
3
votes
1 answer

Proper use of sockets and/or Celluloid::IO

I have a Pinoccio microcontroller (absolutely awesome, try them). The microcontroller opens a socket to it's server. I am writing that TCP Socket server in a Ruby application, in which I will use Celluloid::IO. As my guide, I am following this…
roder
  • 566
  • 6
  • 13
3
votes
0 answers

celluloid task was terminated

When using Guard, I get the following error when running bundle exec guard under cygwin. I can't seem to find much on this error other than this issue: stack level too deep (SystemStackError) · Issue #172 · guard/listen · GitHub Does anybody know…
IKY.LI
  • 189
  • 4
3
votes
1 answer

Proper way to maintain many connections with Celluloid?

I am currently working on an application that pulls mail from many IMAP mailboxes. It seems like Celluloid is a goot fit for this part, but I'm unsure on how to employ actors. The application will be run in a distributed fashion. There are x…
Martijn
  • 1,662
  • 15
  • 21
3
votes
1 answer

Process.spawn hanging

I'm using Celluloid to create a job processing server. I have a pool of workers that take a task from a beanstalkd queue and process it by using Process.spawn to call a PHP script that does a bunch of work. Here's how I'm executing the PHP…
chroder
  • 4,393
  • 2
  • 27
  • 42
2
votes
1 answer

Animations in python using celluloid

I was trying the first simple animation from this page. I am clearly a beginner at making animations. I paste the code below. from matplotlib import pyplot as plt from celluloid import Camera fig = plt.figure() camera = Camera(fig) for i in…
sreeram
  • 125
  • 4
2
votes
1 answer

how to successfully mock Celluloid with rspec

Well, I'm exhausted. Exhausted in a sense run out of options. We have Supervisor that manage an actor(s). supervisor = Celluloid::SupervisionGroup.run! airbrake = supervisor.pool(Flango::AirbrakeActor, as: :airbrake_actor, size: 1) All I need to…
Ratatouille
  • 1,372
  • 5
  • 23
  • 50
2
votes
0 answers

Ruby - Concurrent multiple async Non-Blocking HTTP IO with EventMachine/Celluloid

I am using a puma server for a service that aggregates responses from 14 HTTP Client requests. I have some dependency between the requests, but they can be paralleled in some level. Each request can take 1.8s seconds while the ruby/cpu time is only…
naviram
  • 1,445
  • 1
  • 15
  • 26
2
votes
2 answers

Ruby Celluloid "environment"

I am very new to Celluloid, but I don't understand why, in my Rails app, my futures loose the current locale: puts "locale OUTSIDE #{I18n.locale}" data.map do |item| Celluloid::Future.new { puts "locale INSIDE #{I18n.locale}"; serialize_item(item)…
masciugo
  • 1,113
  • 11
  • 19
2
votes
1 answer

require 'celluloid' takes a long time to load

I have a JRuby application deployed on Google compute engine. I noticed that it takes a while to load the celluloid gem. After looking into more details, I found that it is taking more time to load celluloid/internals/stack. Usually, it takes more…
Pandurang Waghulde
  • 995
  • 1
  • 6
  • 19
2
votes
0 answers

How to use celluloid and ActiveRecord

I am using celluloid to perform some jobs in the background, some of the jobs are using the DB and for that I use the below code in a cell(actor): ActiveRecord::Base.connection_pool.with_connection do User.find(123) end In some cases I have some…
user2502761
  • 563
  • 1
  • 6
  • 18
2
votes
1 answer

Celluloid SupervisionGroup does not work

I write the following script in order to understand Celluloid. require 'celluloid/current' class Processor include Celluloid def perfom(number) puts "#{number} ... (#{Thread.current}) ..." sleep(number%3) puts "Launch finish!" …
Naremy
  • 491
  • 8
  • 22