简体   繁体   中英

Do Ruby Resque workers run in parallel?

I queued up a bunch of jobs given each one an id that gets printed out. What I find surprising is when I queue up 140 jobs each with varying sleep(n) in them I still see the output of the workers in sequential order. Here is some example output of pulling down pages from an external http api:

Page: 124 Page: 125 Page: 126 Page: 127 Page: 128 Page: 129 Page: 130 Page: 131 Page: 132 Page: 133

Shouldn't this come back out of order since each page could take different amount of time?

Each resque worker runs in a single thread. If you only have one resque worker processing a given queue, that queue will be processed serially. If multiple resque workers process a single queue you should see the results come back out of order as you expected.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM