cookbook 'thread', '~> 0.1.0'
thread (1) Versions 0.1.0 Follow0
Allows executing resources in a separate thread
cookbook 'thread', '~> 0.1.0', :supermarket
knife supermarket install thread
knife supermarket download thread
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
- Fork the repository on Github
- Create a named feature branch (like
add_component_x
) - Write you change
- Write tests for your change (if applicable)
- Run the tests, ensuring they all pass
- 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
0.1.0 failed this 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
0.1.0 failed this metric
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
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
0.1.0 failed this 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