diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2019-10-02 14:29:45 -0700 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2019-10-02 14:29:45 -0700 |
commit | 556f3201f5197f1df9814fbeaeb0e028a97b067f (patch) | |
tree | f4e8b8e0216ab6dddbcc4ce1918ce621dc3cdaf3 /lib/chef | |
parent | 8a153f06cd1e0e3a52232d957ef6868c6efc7b0b (diff) | |
download | chef-556f3201f5197f1df9814fbeaeb0e028a97b067f.tar.gz |
Event dispatcher thread local storage
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'lib/chef')
-rw-r--r-- | lib/chef/event_dispatch/dispatcher.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/chef/event_dispatch/dispatcher.rb b/lib/chef/event_dispatch/dispatcher.rb index 2fee4bcd0b..748a04f04c 100644 --- a/lib/chef/event_dispatch/dispatcher.rb +++ b/lib/chef/event_dispatch/dispatcher.rb @@ -10,11 +10,13 @@ class Chef class Dispatcher < Base attr_reader :subscribers - attr_reader :event_list def initialize(*subscribers) @subscribers = subscribers - @event_list = [] + end + + def event_list + Thread.current[:chef_client_event_list] ||= [] end # Add a new subscriber to the list of registered subscribers |