Class: Microsandbox::LogStream
- Inherits:
-
Object
- Object
- Microsandbox::LogStream
- Includes:
- Enumerable
- Defined in:
- lib/microsandbox/streams.rb
Overview
Note:
Single-pass, forward-only, single-consumer. each drains a
one-shot native channel, so it is not rewindable: a second each — or
any Enumerable combinator after a partial drain (to_a twice, count
then each, first(n) then each) — silently yields nothing. Iterate
exactly once, from one thread. With follow: true, each blocks the
calling thread uninterruptibly until the sandbox stops (see DESIGN.md on
GVL release).
A live stream of LogEntrys, returned by Sandbox#log_stream. Enumerable:
iterate to consume entries as they are appended. With follow: true the
iteration blocks for new entries until the sandbox stops; otherwise it ends
once the historical log is drained.
Instance Method Summary collapse
- #each {|entry| ... } ⇒ self, Enumerator
-
#initialize(native) ⇒ LogStream
constructor
A new instance of LogStream.
Constructor Details
#initialize(native) ⇒ LogStream
Returns a new instance of LogStream.
22 23 24 |
# File 'lib/microsandbox/streams.rb', line 22 def initialize(native) @native = native end |