Project

performer

0.0
No commit activity in last 3 years
No release in over 3 years
Performer is a tiny gem for scheduling blocks in a background thread, and optionally waiting for the return value.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.6
>= 0
~> 3.0
~> 0.8
 Project Readme

Performer

Build Status Code Climate Gem Version

gem install performer

Performer is a tiny gem for scheduling blocks in a background thread, and optionally waiting for the return value.

Usage

performer = Performer.new

result = performer.sync { 2 + 1 }
result # => 3

future = performer.async { 2 + 1 }
future.value # => 3

future = performer.shutdown do
  puts "Performer has been properly shutdown."
end

future.value # wait for shutdown

See documentation for Performer and Performer::Task.