Class: Workato::Connector::Sdk::Stream::Proxy Private

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/workato/connector/sdk/stream.rb

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 Method Summary collapse

Constructor Details

#initialize(name:, input:, stream:) ⇒ 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.

Parameters:



177
178
179
180
181
# File 'lib/workato/connector/sdk/stream.rb', line 177

def initialize(name:, input:, stream:)
  @name = name
  @input = input
  @stream = stream
end

Instance Method Details

#as_json(_options = nil) ⇒ Hash{String => T.untyped}

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.

Parameters:

  • _options (T.untyped) (defaults to: nil)

Returns:

  • (Hash{String => T.untyped})


184
185
186
187
188
189
190
# File 'lib/workato/connector/sdk/stream.rb', line 184

def as_json(_options = nil)
  {
    __stream__: true,
    name: name,
    input: input
  }
end

#read(from:, frame_size:, &_blk) ⇒ 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.

Parameters:



193
194
195
196
197
198
199
200
201
202
# File 'lib/workato/connector/sdk/stream.rb', line 193

def read(from:, frame_size:, &_blk)
  next_from = from
  loop do
    res = read_chunk(next_from, frame_size)
    yield(res.data, res.from, res.eof, res.next_from)
    break if res.eof

    next_from = T.must(res.next_from)
  end
end