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
1
vote
0 answers

How to make #future calls on Celluloid pool blocking?

I'm trying to create pool of workers which will perform some HTTP communication and compute values using results. My initial approach looks like this: class Worker include Celluloid ... end pool = Worker.pool(size: 5) collection.map do …
samuil
  • 5,001
  • 1
  • 37
  • 44
1
vote
1 answer

`require': cannot load such file -- celluloid/current (LoadError)

/Users/siva/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:275:in `require': cannot load such file -- celluloid/current (LoadError) from…
user2039907
  • 15
  • 1
  • 5
1
vote
1 answer

Database pool CelluloidZMQ vs Celluloid vs Thread

I'm seeing some sort of weird issue which I'm trying to understand, the first part of that issue is trying to understand how is Database Pool work in Celluloid vs Celluloid/ZMQ. Database Pool. 1) THREAD. 5.times do Thread.new do puts…
Viren
  • 5,812
  • 6
  • 45
  • 98
1
vote
1 answer

celluloid actor - how to terminate all actors with Celluloid.shutdown_timeout while using futures

require 'celluloid/current' Celluloid.shutdown_timeout = 1 class Mapper include Celluloid attr_accessor :value def run(num) @value = num.times.map { |idx| idx } end end y = Mapper.spawn y.future.run(1000000) Till now it…
1
vote
1 answer

How to disable GIL in ruby?

I am pretty much new to Ruby and I was working on a project to run a multithreaded ruby program implemented using celluloid library. It seems like when I try to run the program using the command: ruby program_name.rb The code don't run properly…
kishoredbn
  • 2,007
  • 4
  • 28
  • 47
1
vote
1 answer

Understanding Celluloid Pool

I guess my understanding toward Celluloid Pool is sort of broken. I will try to explain below but before that a quick note. Note: Our system is running against a very fast client passing messages over ZeroMQ. With the following Vanilla Celluloid…
Viren
  • 5,812
  • 6
  • 45
  • 98
1
vote
1 answer

Defer with celluloid ZMQ causing data issue

Sample Code to explain my problem. Sender The Sender, that sends the request to the Server(over ZMQ) in format ["sender-1", "sender-1-bdc1c14624076b691b8d9e15fbd754f1"] .. ["sender-99","sender-99-a2123d02c2989ef57da370bb13ba60e4"] Server…
Ratatouille
  • 1,372
  • 5
  • 23
  • 50
1
vote
1 answer

Celluloid Futures not faster than synchronous computation?

I'm trying to use Celluloid to process some .csv data asynchronously. I've read that using futures enables you to wait for a pool of actors to finish before the main thread terminates. I've looked at some examples that demonstrate this. However,…
Erik Froese
  • 103
  • 7
1
vote
0 answers

What is wrong with my Celluloid actors

I'm playing with celluloid gem. The example works well, but when I press Ctrl-C I get the unexpected message: ^CD, [2015-10-07T09:53:19.784411 #16326] DEBUG -- : Terminating 8 actors... and after few seconds, I get the error: E,…
zuba
  • 1,488
  • 1
  • 17
  • 50
1
vote
1 answer

"ERROR -- : Actor crashed! Celluloid::DeadActorError: attempted to call a dead actor" when running "jekyll watch" or "jekyll serve"

When I run jekyll watch Jekyll will detect one change then will stop detecting any further changes. Upon canceling by hitting Ctrl+C, I get this output: E, [2015-07-23T15:38:41.307871 #1094] ERROR -- : Actor crashed! Celluloid::DeadActorError:…
Ethan
  • 11
  • 2
1
vote
2 answers

Why is the error `Celluloid::Condition signaled spuriously` caused in Celluloid?

I'm trying to wait on a condition of an async code, here's the snippet: condition = Celluloid::Condition.new Rails.logger.debug "Sending RPC request to #{subject}" NATS.start uri: ENV['NATS_SERVER'] do Rails.logger.debug "Connected to…
David Pelaez
  • 1,374
  • 1
  • 13
  • 16
1
vote
1 answer

Why do I get random errors by using celluloid?

I need to make API calls to a webservice in order to retrieve date. For this purpose I created a sample in order to get familiar with celluloid. Here I ll user the openweather API for "training" purpose. The ultimate goal is to run multiple requests…
dc10
  • 2,160
  • 6
  • 29
  • 46
1
vote
1 answer

Workaround for Timeouts with Http.rb and Celluloid?

I know that current timeouts are currently not supported with Http.rb and Celluloid[1], but is there an interim workaround? Here's the code I'd like to run: def fetch(url, options = {} ) puts "Request -> #{url}" begin options =…
aronchick
  • 6,786
  • 9
  • 48
  • 75
1
vote
1 answer

Dynamically assigning actors in Celluloid

I'm learning how to use Celluloid. I’ve read all the documentation and think I have the idea of how to use it but lack practise. I'm about to test it with a CSV file with almost 12,000 rows.  I’m unsure how many actors I should assign to a job. I'm…
Dol
  • 944
  • 3
  • 10
  • 25
1
vote
2 answers

Ruby future buffer?

I want to get a bunch a XML and parse them. They are somewhat large. So I was thinking I could get and parse them in a future like this:(I currently use Celluloid) country_xml = {} country_pool = GetAndParseXML.pool size: 4, args:…
user3384741
  • 1,261
  • 3
  • 16
  • 21