Adoptable Cookbooks List

Looking for a cookbook to adopt? You can now see a list of cookbooks available for adoption!
List of Adoptable Cookbooks

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the Chef Mailing List.

Select Badges

Select Supported Platforms

Select Status

RSS

thread (1) Versions 0.1.0

Allows executing resources in a separate thread

Policyfile
Berkshelf
Knife
cookbook 'thread', '~> 0.1.0', :supermarket
cookbook 'thread', '~> 0.1.0'
knife supermarket install thread
knife supermarket download thread
README
Dependencies
Quality 17%

thread Cookbook

Provides an lwrp to execute start in parallel (via threads).

Requirements

Chef 10.18 or higher

Attributes

thread::pool

<table>
<tr>
<th>Key</th>
<th>Type</th>
<th>Description</th>
<th>Default</th>
</tr>
<tr>
<td><tt>['thread']['pool']</tt></td>
<td>Integer</td>
<td>Number of thread in the pool</td>
<td><tt>10</tt></td>
</tr>
</table>

Usage

thread::default

thread 'something time consuming' do
  block do
    execute "ping -c 8.8.8.8" 
  end
end

thread 'something time consuming' do
  block do
    execute "ping -c 8.8.8.8" 
  end
end

thread_join "wait till finish"

Description

This cookbook aims to provide raw parallization using standard ruby threads, without any mutex or any other data integrety support.
Long running commands, like downloading tar balls, writing large files, or waiting for any ther network resource is typical use case.

Currently two resources are offered as part of this cookbooks. The reource thread is used for parallelization , it accepts a block,
which can have any valid chef resources. thread resource creates a sub resource context and runs a parallel convergence in with the given block
in a separate thread.

The second resource thread_join is used for joining back the thread. This is a blocking call, and it will pause the excution till the threads are finished.
You must specify this resource. Else bad things can happen

Contributing

  1. Fork the repository on Github
  2. Create a named feature branch (like add_component_x)
  3. Write you change
  4. Write tests for your change (if applicable)
  5. Run the tests, ensuring they all pass
  6. Submit a Pull Request using Github

License and Authors

Authors: Ranjib Dey (dey.ranjib@gmail.com)

Dependent cookbooks

This cookbook has no specified dependencies.

Contingent cookbooks

There are no cookbooks that are contingent upon this one.

Collaborator Number Metric
            

0.1.0 failed this metric

Failure: Cookbook has 0 collaborators. A cookbook must have at least 2 collaborators to pass this metric.

Contributing File Metric
            

0.1.0 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file

Foodcritic Metric
            

0.1.0 failed this metric

FC064: Ensure issues_url is set in metadata: thread/metadata.rb:1
FC065: Ensure source_url is set in metadata: thread/metadata.rb:1
FC066: Ensure chef_version is set in metadata: thread/metadata.rb:1
FC067: Ensure at least one platform supported in metadata: thread/metadata.rb:1
FC069: Ensure standardized license defined in metadata: thread/metadata.rb:1
FC085: Resource using new_resource.updated_by_last_action to converge resource: thread/libraries/thread_provider.rb:35
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any

No Binaries Metric
            

0.1.0 passed this metric

Testing File Metric
            

0.1.0 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file

Version Tag Metric
            

0.1.0 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number