Class: ArrowFlight::Client
- Inherits:
-
Object
- Object
- ArrowFlight::Client
- Defined in:
- lib/arrow-flight/client.rb
Instance Method Summary collapse
-
#authenticate_basic(user, password, options = nil) ⇒ ArrowFlight::CallOptions
Authenticates by Basic authentication.
-
#do_put(descriptor, schema, options = nil) {|writer, reader| ... } ⇒ Array<GArrowFlight::MetadataReader, GArrowFlight::StreamWriter>, Object
Upload data to a Flight described by the given descriptor.
- #do_put_raw ⇒ Object
Instance Method Details
#authenticate_basic(user, password, options = nil) ⇒ ArrowFlight::CallOptions
Authenticates by Basic authentication.
37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/arrow-flight/client.rb', line 37 def authenticate_basic(user, password, =nil) unless .is_a?(CallOptions) = CallOptions.try_convert() end ||= CallOptions.new _success, bearer_name, bearer_value = authenticate_basic_token(user, password, ) invalid_bearer = (bearer_name.empty? or bearer_value.empty?) unless invalid_bearer .add_header(bearer_name, bearer_value) end end |
#do_put(descriptor, schema, options = nil) {|writer, reader| ... } ⇒ Array<GArrowFlight::MetadataReader, GArrowFlight::StreamWriter>, Object
Upload data to a Flight described by the given descriptor. The caller must call ‘#close` on the returned stream once they are done writing. Note that it’s automatically done when you use block.
The reader and writer are linked; closing the writer will also close the reader. Use GArrowFlight::StreamWriter#done_writing to only close the write side of the channel.
80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/arrow-flight/client.rb', line 80 def do_put(descriptor, schema, =nil) result = do_put_raw(descriptor, schema, ) reader = result.reader writer = result.writer if block_given? begin yield(reader, writer) ensure writer.close unless writer.closed? end else return reader, writer end end |
#do_put_raw ⇒ Object
51 |
# File 'lib/arrow-flight/client.rb', line 51 alias_method :do_put_raw, :do_put |