Class: PumaAfterReply::ReplyCollector Private
- Inherits:
-
Object
- Object
- PumaAfterReply::ReplyCollector
- Defined in:
- lib/puma_after_reply/reply_collector.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Attribute Summary collapse
- #inline_replies ⇒ Array<#call|Proc> readonly private
- #threaded_replies ⇒ ARray<#call|Proc> readonly private
Class Method Summary collapse
Instance Method Summary collapse
- #add_reply(reply, threaded:) ⇒ void private
- #clear ⇒ void private
- #initialize ⇒ void constructor private
- #inline__each(&block) ⇒ void private
- #inline__each_and_flush(&block) ⇒ void private
- #replies ⇒ Array<#call,Proc> private
- #size ⇒ Integer private
- #threaded__each(&block) ⇒ void private
- #threaded__each_and_flush(&block) ⇒ void private
Constructor Details
#initialize ⇒ void
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
32 33 34 35 |
# File 'lib/puma_after_reply/reply_collector.rb', line 32 def initialize @inline_replies = [] @threaded_replies = [] end |
Instance Attribute Details
#inline_replies ⇒ Array<#call|Proc> (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
20 21 22 |
# File 'lib/puma_after_reply/reply_collector.rb', line 20 def inline_replies @inline_replies end |
#threaded_replies ⇒ ARray<#call|Proc> (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
26 27 28 |
# File 'lib/puma_after_reply/reply_collector.rb', line 26 def threaded_replies @threaded_replies end |
Class Method Details
.current ⇒ PumaAfterReply::ReplyCollector
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
11 12 13 |
# File 'lib/puma_after_reply/reply_collector.rb', line 11 def current Thread.current[:puma_after_reply_replies_collector] ||= new end |
Instance Method Details
#add_reply(reply, threaded:) ⇒ void
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
This method returns an undefined value.
43 44 45 |
# File 'lib/puma_after_reply/reply_collector.rb', line 43 def add_reply(reply, threaded:) threaded ? threaded_replies << reply : inline_replies << reply end |
#clear ⇒ void
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
This method returns an undefined value.
67 68 69 70 |
# File 'lib/puma_after_reply/reply_collector.rb', line 67 def clear inline_replies.clear threaded_replies.clear end |
#inline__each(&block) ⇒ void
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
This method returns an undefined value.
99 100 101 102 103 |
# File 'lib/puma_after_reply/reply_collector.rb', line 99 def inline__each(&block) # :nocov: inline_replies.each(&block) # :nocov: end |
#inline__each_and_flush(&block) ⇒ void
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
This method returns an undefined value.
110 111 112 113 114 |
# File 'lib/puma_after_reply/reply_collector.rb', line 110 def inline__each_and_flush(&block) inline_replies.each(&block) ensure inline_replies.clear end |
#replies ⇒ Array<#call,Proc>
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
51 52 53 |
# File 'lib/puma_after_reply/reply_collector.rb', line 51 def replies threaded_replies + inline_replies end |
#size ⇒ Integer
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
59 60 61 |
# File 'lib/puma_after_reply/reply_collector.rb', line 59 def size inline_replies.size + threaded_replies.size end |
#threaded__each(&block) ⇒ void
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
This method returns an undefined value.
77 78 79 80 81 |
# File 'lib/puma_after_reply/reply_collector.rb', line 77 def threaded__each(&block) # :nocov: threaded_replies.each(&block) # :nocov: end |
#threaded__each_and_flush(&block) ⇒ void
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
This method returns an undefined value.
88 89 90 91 92 |
# File 'lib/puma_after_reply/reply_collector.rb', line 88 def threaded__each_and_flush(&block) threaded_replies.each(&block) ensure threaded_replies.clear end |