Class: VertxSqlClient::Cursor
- Inherits:
-
Object
- Object
- VertxSqlClient::Cursor
- Defined in:
- /Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-sql-client/cursor.rb
Overview
A cursor that reads progressively rows from the database, it is useful for reading very large result sets.
Constant Summary
- @@j_api_type =
Object.new
Class Method Summary (collapse)
- + (Boolean) accept?(obj)
- + (Object) j_api_type
- + (Object) j_class
- + (Object) unwrap(obj)
- + (Object) wrap(obj)
Instance Method Summary (collapse)
-
- (void) close
Like #close but with a completionHandler called when the cursor has been released.
-
- (true, false) hasMore
Returns true when the cursor has results in progress and the #read should be called to retrieve them.
-
- (void) read(count, handler) { ... }
Read rows from the cursor, the result is provided asynchronously to the handler.
Class Method Details
+ (Boolean) accept?(obj)
20 21 22 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-sql-client/cursor.rb', line 20 def @@j_api_type.accept?(obj) obj.class == Cursor end |
+ (Object) j_api_type
29 30 31 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-sql-client/cursor.rb', line 29 def self.j_api_type @@j_api_type end |
+ (Object) j_class
32 33 34 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-sql-client/cursor.rb', line 32 def self.j_class Java::IoVertxSqlclient::Cursor.java_class end |
+ (Object) unwrap(obj)
26 27 28 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-sql-client/cursor.rb', line 26 def @@j_api_type.unwrap(obj) obj.j_del end |
+ (Object) wrap(obj)
23 24 25 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-sql-client/cursor.rb', line 23 def @@j_api_type.wrap(obj) Cursor.new(obj) end |
Instance Method Details
- (void) close - (void) close(completionHandler) { ... }
This method returns an undefined value.
Like #close but with acompletionHandler called when the cursor has been released.
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-sql-client/cursor.rb', line 75 def close if !block_given? return @j_del.java_method(:close, []).call() elsif true if (block_given?) return @j_del.java_method(:close, [Java::IoVertxCore::Handler.java_class]).call(block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? nil : nil) } : promise) else promise = ::Vertx::Util::Utils.promise @j_del.java_method(:close, [Java::IoVertxCore::Handler.java_class]).call(block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? nil : nil) } : promise) return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future, nil) end end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling close()" end end |
- (true, false) hasMore
Returns
true when the cursor has results in progress and the #read should be called to retrieve
them.
60 61 62 63 64 65 66 67 68 69 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-sql-client/cursor.rb', line 60 def has_more? if !block_given? return @j_del.java_method(:hasMore, []).call() end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling has_more?()" end end |
- (void) read(count, handler) { ... }
This method returns an undefined value.
Read rows from the cursor, the result is provided asynchronously to thehandler.
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-sql-client/cursor.rb', line 40 def read(*args) if args[0].class == Fixnum && true if (block_given?) return @j_del.java_method(:read, [Java::int.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ::Vertx::Util::Utils.safe_create(ar.result,::VertxSqlClient::RowSet,::VertxSqlClient::Row.j_api_type) : nil) } : promise) else promise = ::Vertx::Util::Utils.promise @j_del.java_method(:read, [Java::int.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ::Vertx::Util::Utils.safe_create(ar.result,::VertxSqlClient::RowSet,::VertxSqlClient::Row.j_api_type) : nil) } : promise) return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future,::VertxSqlClient::RowSet.j_api_type) end end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling read(#{args[0]})" end end |