vertx-pg-client.pg_stream.rb Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of reactive-pg-client Show documentation
Show all versions of reactive-pg-client Show documentation
The reactive Postgres client
require 'vertx/read_stream'
require 'vertx/util/utils.rb'
# Generated from com.julienviet.pgclient.PgStream
module VertxPgClient
class PgStream
include ::Vertx::ReadStream
# @private
# @param j_del [::VertxPgClient::PgStream] the java delegate
def initialize(j_del, j_arg_T=nil)
@j_del = j_del
@j_arg_T = j_arg_T != nil ? j_arg_T : ::Vertx::Util::unknown_type
end
# @private
# @return [::VertxPgClient::PgStream] the underlying java delegate
def j_del
@j_del
end
# @yield
# @return [self]
def exception_handler
if block_given?
@j_del.java_method(:exceptionHandler, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |event| yield(::Vertx::Util::Utils.from_throwable(event)) }))
return self
end
raise ArgumentError, "Invalid arguments when calling exception_handler()"
end
# @yield
# @return [self]
def handler
if block_given?
@j_del.java_method(:handler, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |event| yield(@j_arg_T.wrap(event)) }))
return self
end
raise ArgumentError, "Invalid arguments when calling handler()"
end
# @return [self]
def pause
if !block_given?
@j_del.java_method(:pause, []).call()
return self
end
raise ArgumentError, "Invalid arguments when calling pause()"
end
# @return [self]
def resume
if !block_given?
@j_del.java_method(:resume, []).call()
return self
end
raise ArgumentError, "Invalid arguments when calling resume()"
end
# @yield
# @return [self]
def end_handler
if block_given?
@j_del.java_method(:endHandler, [Java::IoVertxCore::Handler.java_class]).call(Proc.new { yield })
return self
end
raise ArgumentError, "Invalid arguments when calling end_handler()"
end
end
end