Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    singulars
    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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. COSo instead of creating a (green) Thread, I could use fork(2) instead and git a PID back. This much I have done. How do I work with the block for trap('USR1') which wakes up the thread when I new job hits the queue? How would I create more then one process and get them to pull off the queue optimally. The magic seems to be in pipe and select but I don't understand the intricacies. I can use the daemon gem to create a daemon process which uses fork under the hood. I want to start some child processes to run the queue.
      singulars
    2. CODepends on what "work" means in this context. If "work" is I/O, it might be different and yeah, `select` is important. I prefer to design work queues in such a way that work can be executed in any order. So if work unit #1 gets executed concurrently with work unit #2, that's not an issue. As for the daemons gem... I used to use it, but now I either use `fork` directly or I use my ChainGang library. I found that daemons hid too much important stuff, and it was unnecessary overhead for something that's actually not that hard. Note that ChainGang is very alpha quality.
      singulars
    3. COEssentially, worrying about "pulling off the queue optimally" doesn't make a whole lot of sense in most contexts. Either you're working with I/O, in which case you're probably not using a `delayed_job` queue, or you are executing things as discrete work units, in which case `select` and `pipe` don't make any sense. Either way, the right way to deal with a work queue is to just grab whatever's on top whenever you're free. And if there's nothing there, it's probably OK to just block until there is.
      singulars
 

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