Skip to content

Burgestrand/performer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages