waitgroup

Version, currently 1.0.01 version
  • 1.0.0latestAug 29, 2022

github.com/dscottboggs/waitgroup

A simple implementation of a Waitgroup for Crystal

2 stars
0 dependents
License: MIT

Installation

# Add this to your shard.yml
dependencies:
  waitgroup:
    github: dscottboggs/waitgroup
    version: ~> 1.0.0

Then run:

shards install

shard.yml

Crystal
1.5.0
License
MIT
Author
D. Scott Boggs

Dependencies

This version declares no dependencies.

README

waitgroup

Simple waitgroup implementation for Crystal.

Installation

  1. Add the dependency to your shard.yml:

    dependencies:
      waitgroup:
        github: dscottboggs/waitgroup
  2. Run shards install

Usage

require "waitgroup"

wg = WaitGroup.new
time_taken = Time.measure do
  10.times do
    wg.spawn do
      sleep 1
    end
  end
  wg.wait
end

time_taken.should be_close 1.second,
  delta: 0.1.seconds

See the spec file for more examples.

Contributing

  1. Fork it (https://github.com/dscottboggs/waitgroup/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Verify your changes pass all tests, including formatting and linting with ameba
  5. Push to the branch (git push origin my-new-feature)
  6. Create a new Pull Request.

Contributors