chef / cookbook-omnifetch

Fetch Chef Cookbooks from Various Sources to a Local Cache
Apache License 2.0
6 stars 9 forks source link

Multi thread example #18

Closed danielsdeleo closed 7 years ago

danielsdeleo commented 7 years ago

JUST FOR DISCUSSION

ALSO the only relevant commit is the last one, the prior commits come from https://github.com/chef/cookbook-omnifetch/pull/17

The chef_server source in policyfiles is pretty slow. Unfortunately we can't just throw threads at it because Chef::HTTP (parent of Chef::ServerAPI) can't have multiple requests from different threads being made with the same Chef::HTTP object at the same time. But we can make a wrapper around Chef::ServerAPI to make it work. We'd likely have to add some config option to enable thread mode, then put Chef::ServerAPIMulti in ChefDK or something.

Thoughts?

danielsdeleo commented 7 years ago

I added this to the upstream pull request with an option to configure the concurrency level and default of 1 thread. No need for this any more.