Socket
Book a DemoInstallSign in
Socket

process_pool

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

process_pool

0.1.3
bundlerRubygems
Version published
Maintainers
1
Created
Source

Process Pool is something I created to replace a thread pool that had major performance problems caused by Ruby's (MRI) poor thread implementation.

The basic usage is:

class SomeTask def initialize(x, y, z) end

def run end end

pool = ProcessPool.new(5) # first constructor argument is a number of worker processes pool.schedule SomeTask, 1, 2, 3 # adds task SomeTask.new(1,2,3) to the queue (instantiation happens just before calling run()) pool.start # starts the workers pool.schedule SomeTask, 3, 2, 1 # tasks can be added also after calling start pool.shutdown # waits for all the tasks in the queue to be processed and kills all the worker processes

For now there is only one, very naive, queue implementation, which uses file locking and JSON storage format. I plan on adding some other (better) queue backend soon.

FAQs

Package last updated on 18 Feb 2010

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.