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
1 answer

Ruby Celluloid: attach to already in progress Future

Given an instance of a Celluloid Actor, you can use future to execute an Actor method asynchronously and at some later point in time use the Future's value method to obtain the result of the Actor method (blocking if necessary). Let's say that I…
Jason Voegele
  • 1,918
  • 1
  • 19
  • 18
1
vote
2 answers

Shorthand in Ruby, Artoo.io

I am looking for an explanation for what's going on at the top of artoo.io robots. There is a declaration at the top of this example using the keyboard driver: require 'artoo' connection :keyboard, adaptor: :keyboard device :keyboard, driver:…
Quentin Donnellan
  • 2,687
  • 1
  • 18
  • 24
1
vote
2 answers

How do I stop "Terminating task" messages in Celluloid?

I have a worker which reads from a url and retrieves some data. So I'm using pool to achieve concurrency of 10 concurrent workers: require 'nokogiri' require 'open-uri' require 'celluloid/autostart' class WebWorker include Celluloid def…
valk
  • 9,363
  • 12
  • 59
  • 79
1
vote
1 answer

Ensure only one job runs on rails SuckerPunch/Celluloid

I have a simple SuckerPunch job, I am trying to make it so only one job runs at any given time. Struggling to work it out tried playing with Celluloid and Ruby concurrency What I have DataChangeJob.new.async.perform with class DataChangeJob …
dboyd68
  • 1,104
  • 15
  • 33
1
vote
0 answers

How to call block every n seconds with a Celluloid Actor?

I'm trying to create a Celluloid Actor that can accept a &block as a param and execute it every n seconds. However when I call the block from within the every loop, it never seems to do anything? Take this example claass: require…
tob1k
  • 11
  • 3
1
vote
0 answers

Difficulties achieving Celluloid benchmarks in JRuby

I'm seeing some concurrency problems in a library I'm using that implements Celluloid actors. Out of curiosity, I ran the benchmarking script in Celluloid with a couple different interpreters. Ruby 1.9.3 Calculating…
1ijk
  • 1,417
  • 2
  • 19
  • 31
1
vote
1 answer

Supporting newer gems on old ruby (here: Celluloid)

Is it possible, by using backports or something similar, to install and use gems that require a higher version of ruby than what is installed? I am stuck on 1.8 and I am having troubles with the celluloid gem in relation with rspec. I thought that…
Automatico
  • 12,420
  • 9
  • 82
  • 110
1
vote
1 answer

Is there a non-blocking form of Zlib::GzipReader?

I'm attempting to implement a streaming Gzip decompressor using Zlib::GzipReader reading data from a pipe, but I can't seem to figure out how to do it in a non-blocking way. Here's the relevant piece of code: # In thread A read, write =…
bloudermilk
  • 17,820
  • 15
  • 68
  • 98
1
vote
1 answer

Celluloid/Sidekiq & Rails 3.2 with MRI Ruby and an app not previously designed for thread-safety, is it viable?

I've got a big project running on MRI Ruby and Rails 3.2 on Passenger with an app that was not designed with thread-safety in mind and this app handles mailings through DelayedJob and the database is paying a heavy price for this. Some possible…
bbozo
  • 7,075
  • 3
  • 30
  • 56
1
vote
0 answers

Setting up a global Celluloid pool

I am using a Celluloid pool in a Rails application to offload pdf conversions after a user uploaded files. I used an initializer to create a global conversion pool for the application. All went well in my development environment (OS X, thin). And…
smile2day
  • 1,585
  • 1
  • 24
  • 34
1
vote
1 answer

Using redis in jruby threaded setup

So the redis gem is supposed to be thread-safe, that's good. But I am wondering how I need to set it up. I am using jRuby and Celluloid (using default fibers). The way I'm using it now is I have a global method defined: def redis @_redis ||=…
mrbrdo
  • 7,968
  • 4
  • 32
  • 36
1
vote
1 answer

Is there a way to call a block every microsecond using celluloid?

I'm using celluloid's every method to execute a block every microsecond however it seems to always call the block every second even when I specify a decimal. interval = 1.0 / 2.0 every interval do puts "*"*80 puts "Time: #{Time.now}" puts…
rmontgomery429
  • 14,660
  • 17
  • 61
  • 66
1
vote
2 answers

Can't gem install Celluloid using Rubinius 2.0.0

I have rvm set to # .rvmrc rvm use rbx-2.0.0-rc1 and it sets the version correctly $ ruby -v rubinius 2.0.0rc1 (1.8.7 release 2012-11-02 JI) [x86_64-apple-darwin12.2.1] when I try to $ gem install celluloid -v '0.12.3' I get the error ERROR: …
code0100fun
  • 180
  • 1
  • 11
1
vote
0 answers

Non-blocking ruby UNIXSocket

Preamble: Obviously, I am too stupid. I want to expose a simple UNIXSocket in Ruby that accepts a single command from connecting clients without blocking further connections while processing until the socket is closed (which the STDLIB socket does)…
TheDeadSerious
  • 842
  • 8
  • 11
0
votes
0 answers

Quality issue when saving animation on another thread. (with pyqt5 GUI)

As I care a lot about user experiance, I wanted to keep updating progress bar while main thread save animation. (I plot each frame on main thread. only saving work is on another thread) However, saving animation on second thread makes result of low…