tlopo-executor
A simple Executor service aka Threadpool executor
Installation
Add this line to your application's Gemfile:
gem 'tlopo-executor'
And then execute:
bundle
Or install it yourself as:
gem install tlopo-executor
Usage
Simple usage
require 'tlopo/executor'
require 'socket'
require 'timeout'
exec = Tlopo::Executor.new
['80','443','22'].each do |port|
exec.schedule(
proc do
begin
Timeout.timeout(1){TCPSocket.new('www.google.co.uk', port ).close}
rescue
raise "Port #{port} is not open"
end
end
)
end
errors = exec.run.errors
p errors unless exec.success?
Contributing
- Fork it ( https://github.com/[my-github-username]/kubeclient/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Test your changes with
rake test rubocop
, add new tests if needed. - If you added a new functionality, add it to README
- Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
Tests
This library is tested with Minitest. Please run all tests before submitting a Pull Request, and add new tests for new functionality.
Running tests:
rake test