Note that there are some explanatory texts on larger screens.

plurals
  1. POSetting up a global Celluloid pool
    primarykey
    data
    text
    <p>I am using a Celluloid pool in a Rails application to offload pdf conversions after a user uploaded files.</p> <p>I used an initializer to create a global conversion pool for the application.</p> <p>All went well in my development environment (OS X, thin). And also no problem running it on my CentOS box (Apache, Passenger).</p> <p>This is basically the initial setup:</p> <p>config/initializers/converter_pool.rb</p> <pre><code>require './lib/x/convert_async' CONVERT_POOL=X::ConvertAsync.pool </code></pre> <p>lib/X/convert.rb</p> <pre><code>module X class Convert end end </code></pre> <p>lib/X/convert_async.rb</p> <pre><code>require_relative 'convert' module X class ConvertAsync &lt; Convert include Celluloid end end </code></pre> <p>At some stage my pool stopped working on the CentOS box (usertest env) but continued ok in my development environment.</p> <p>Additional note: Pool still worked when the methods updating the images was called through the console. I guess the problem had to do with load order or permissions of some kind.</p> <p>Not sure what caused it - there was a new Linux kernel and updates to gems.</p> <p>After various attempts I finally got it working again by initializing the pool after the class definition and removing the initializer for the pool.</p> <pre><code>module X class ConvertAsync &lt; Convert include Celluloid end end CONVERT_POOL=X::ConvertAsync.pool </code></pre> <p>I still have Questions since I like to understand better what happened.</p> <p>Does anybody know what might have caused it? It is a bad idea to instantiate a Celluloid pool after the class definition? Are there any potential issues?</p> <p>Many thanks in advance for anyone who can shed some light :) Cheers, Eugen</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload