Module: Hsdq::ThreadStore
- Included in:
- Hsdq
- Defined in:
- lib/hsdq/thread_store.rb
Instance Method Summary collapse
-
#context(data = nil) ⇒ Object
Specialized proxy for set_get the key is the method name.
-
#context_params(data = nil) ⇒ Object
Specialized proxy for set_get the key is the method name.
-
#current_uid(data = nil) ⇒ Object
Specialized proxy for set_get the key is the method name.
-
#previous_sender(data = nil) ⇒ Object
Specialized proxy for set_get the key is the method name.
-
#reply_to(data = nil) ⇒ Object
Specialized proxy for set_get the key is the method name.
-
#sent_to(data = nil) ⇒ Object
Specialized proxy for set_get the key is the method name.
-
#set_get(key, data = nil) ⇒ Stored value
Return the value stored into the corresponding thread.current key only if no data is passed.
Instance Method Details
#context(data = nil) ⇒ Object
Specialized proxy for set_get the key is the method name
6 7 8 |
# File 'lib/hsdq/thread_store.rb', line 6 def context(data=nil) set_get __method__, data end |
#context_params(data = nil) ⇒ Object
Specialized proxy for set_get the key is the method name
12 13 14 |
# File 'lib/hsdq/thread_store.rb', line 12 def context_params(data=nil) set_get __method__, data end |
#current_uid(data = nil) ⇒ Object
Specialized proxy for set_get the key is the method name
18 19 20 |
# File 'lib/hsdq/thread_store.rb', line 18 def current_uid(data=nil) set_get __method__, data end |
#previous_sender(data = nil) ⇒ Object
Specialized proxy for set_get the key is the method name
24 25 26 |
# File 'lib/hsdq/thread_store.rb', line 24 def previous_sender(data=nil) set_get __method__, data end |
#reply_to(data = nil) ⇒ Object
Specialized proxy for set_get the key is the method name
36 37 38 |
# File 'lib/hsdq/thread_store.rb', line 36 def reply_to(data=nil) set_get __method__, data end |
#sent_to(data = nil) ⇒ Object
Specialized proxy for set_get the key is the method name
30 31 32 |
# File 'lib/hsdq/thread_store.rb', line 30 def sent_to(data=nil) set_get __method__, data end |
#set_get(key, data = nil) ⇒ Stored value
Return the value stored into the corresponding thread.current key only if no data is passed
43 44 45 46 |
# File 'lib/hsdq/thread_store.rb', line 43 def set_get(key, data=nil) Thread.current[key] = data if data Thread.current[key] end |