Class: Vertx::Vertx
- Inherits:
-
Object
- Object
- Vertx::Vertx
- Includes:
- Measured
- Defined in:
- /Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/vertx.rb
Overview
You use an instance of this class for functionality including:
- Creating TCP clients and servers
- Creating HTTP clients and servers
- Creating DNS clients
- Creating Datagram sockets
- Setting and cancelling periodic and one-shot timers
- Getting a reference to the event bus API
- Getting a reference to the file system API
- Getting a reference to the shared data API
- Deploying and undeploying verticles
Most functionality in Vert.x core is fairly low level.
To create an instance of this class you can use the static factory methods: #vertx, #vertx and #clustered_vertx.
Please see the user manual for more detailed usage information.
Constant Summary
- @@j_api_type =
Object.new
Class Method Summary (collapse)
- + (Boolean) accept?(obj)
-
+ (void) clustered_vertx(options = nil) { ... }
Creates a clustered instance using the specified options.
-
+ (::Vertx::Context) current_context
Gets the current context.
- + (Object) j_api_type
- + (Object) j_class
- + (Object) unwrap(obj)
-
+ (::Vertx::Vertx) vertx(options = nil)
Creates a non clustered instance using the specified options.
- + (Object) wrap(obj)
Instance Method Summary (collapse)
-
- (true, false) cancel_timer?(id = nil)
Cancels the timer with the specified id.
-
- (void) close { ... }
Like #close but the completionHandler will be called when the close is complete.
-
- (true, false) clustered?
Is this Vert.x instance clustered?.
-
- (::Vertx::DatagramSocket) create_datagram_socket(options = nil)
Create a datagram socket using the specified options.
-
- (::Vertx::DnsClient) create_dns_client(param_1 = nil, param_2 = nil)
Create a DNS client to connect to a DNS server at the specified host and port, with the default query timeout (5 seconds).
-
- (::Vertx::HttpClient) create_http_client(options = nil)
Create a HTTP/HTTPS client using the specified options.
-
- (::Vertx::HttpServer) create_http_server(options = nil)
Create an HTTP/HTTPS server using the specified options.
-
- (::Vertx::NetClient) create_net_client(options = nil)
Create a TCP/SSL client using the specified options.
-
- (::Vertx::NetServer) create_net_server(options = nil)
Create a TCP/SSL server using the specified options.
-
- (::Vertx::WorkerExecutor) create_shared_worker_executor(name = nil, poolSize = nil, maxExecuteTime = nil, maxExecuteTimeUnit = nil)
Create a named worker executor, the executor should be closed when it's not needed anymore to release resources.
-
- (void) deploy_verticle(name = nil, options = nil) { ... }
Like #deploy_verticle but => Object} are provided to configure the deployment.
-
- (Set<String>) deployment_i_ds
Return a Set of deployment IDs for the currently deployed deploymentIDs.
-
- (::Vertx::EventBus) event_bus
Get the event bus object.
-
- (self) exception_handler { ... }
Set a default exception handler for Context, set on at creation.
-
- (void) execute_blocking(blockingCodeHandler = nil, ordered = nil) { ... }
Safely execute some blocking code.
-
- (::Vertx::FileSystem) file_system
Get the filesystem object.
-
- (::Vertx::Context) get_or_create_context
Gets the current context, or creates one if there isn't one.
-
- (true, false) metrics_enabled?
Whether the metrics are enabled for this measured object.
-
- (true, false) native_transport_enabled?
Whether the native transport is used.
-
- (::Vertx::TimeoutStream) periodic_stream(delay = nil)
Returns a periodic timer as a read stream.
-
- (void) run_on_context { ... }
Puts the handler on the event queue for the current context so it will be run asynchronously ASAP after all preceeding events have been handled.
-
- (Fixnum) set_periodic(delay = nil) { ... }
Set a periodic timer to fire every delay milliseconds, at which point handler will be called with the id of the timer.
-
- (Fixnum) set_timer(delay = nil) { ... }
Set a one-shot timer to fire after delay milliseconds, at which point handler will be called with the id of the timer.
-
- (::Vertx::SharedData) shared_data
Get the shared data object.
-
- (::Vertx::TimeoutStream) timer_stream(delay = nil)
Returns a one-shot timer as a read stream.
-
- (void) undeploy(deploymentID = nil) { ... }
Like #undeploy(String) but the completionHandler will be notified when the undeployment is complete.
Class Method Details
+ (Boolean) accept?(obj)
53 54 55 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/vertx.rb', line 53 def @@j_api_type.accept?(obj) obj.class == Vertx end |
+ (void) clustered_vertx(options = nil) { ... }
This method returns an undefined value.
Creates a clustered instance using the specified options.The instance is created asynchronously and the resultHandler is called with the result when it is ready.
93 94 95 96 97 98 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/vertx.rb', line 93 def self.clustered_vertx(=nil) if .class == Hash && true return Java::IoVertxCore::Vertx.java_method(:clusteredVertx, [Java::IoVertxCore::VertxOptions.java_class,Java::IoVertxCore::Handler.java_class]).call(Java::IoVertxCore::VertxOptions.new(::Vertx::Util::Utils.to_json_object()),(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ::Vertx::Util::Utils.safe_create(ar.result,::Vertx::Vertx) : nil) } unless !block_given?)) end raise ArgumentError, "Invalid arguments when calling clustered_vertx(#{})" end |
+ (::Vertx::Context) current_context
101 102 103 104 105 106 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/vertx.rb', line 101 def self.current_context if !block_given? return ::Vertx::Util::Utils.safe_create(Java::IoVertxCore::Vertx.java_method(:currentContext, []).call(),::Vertx::Context) end raise ArgumentError, "Invalid arguments when calling current_context()" end |
+ (Object) j_api_type
62 63 64 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/vertx.rb', line 62 def self.j_api_type @@j_api_type end |
+ (Object) j_class
65 66 67 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/vertx.rb', line 65 def self.j_class Java::IoVertxCore::Vertx.java_class end |
+ (Object) unwrap(obj)
59 60 61 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/vertx.rb', line 59 def @@j_api_type.unwrap(obj) obj.j_del end |
+ (::Vertx::Vertx) vertx(options = nil)
79 80 81 82 83 84 85 86 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/vertx.rb', line 79 def self.vertx(=nil) if !block_given? && == nil return ::Vertx::Util::Utils.safe_create(Java::IoVertxCore::Vertx.java_method(:vertx, []).call(),::Vertx::Vertx) elsif .class == Hash && !block_given? return ::Vertx::Util::Utils.safe_create(Java::IoVertxCore::Vertx.java_method(:vertx, [Java::IoVertxCore::VertxOptions.java_class]).call(Java::IoVertxCore::VertxOptions.new(::Vertx::Util::Utils.to_json_object())),::Vertx::Vertx) end raise ArgumentError, "Invalid arguments when calling vertx(#{})" end |
+ (Object) wrap(obj)
56 57 58 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/vertx.rb', line 56 def @@j_api_type.wrap(obj) Vertx.new(obj) end |
Instance Method Details
- (true, false) cancel_timer?(id = nil)
id.
267 268 269 270 271 272 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/vertx.rb', line 267 def cancel_timer?(id=nil) if id.class == Fixnum && !block_given? return @j_del.java_method(:cancelTimer, [Java::long.java_class]).call(id) end raise ArgumentError, "Invalid arguments when calling cancel_timer?(#{id})" end |
- (void) close { ... }
This method returns an undefined value.
Like #close but the completionHandler will be called when the close is complete
286 287 288 289 290 291 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/vertx.rb', line 286 def close if true return @j_del.java_method(:close, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |ar| yield(ar.failed ? ar.cause : nil) } unless !block_given?)) end raise ArgumentError, "Invalid arguments when calling close()" end |
- (true, false) clustered?
326 327 328 329 330 331 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/vertx.rb', line 326 def clustered? if !block_given? return @j_del.java_method(:isClustered, []).call() end raise ArgumentError, "Invalid arguments when calling clustered?()" end |
- (::Vertx::DatagramSocket) create_datagram_socket(options = nil)
162 163 164 165 166 167 168 169 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/vertx.rb', line 162 def create_datagram_socket(=nil) if !block_given? && == nil return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:createDatagramSocket, []).call(),::Vertx::DatagramSocket) elsif .class == Hash && !block_given? return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:createDatagramSocket, [Java::IoVertxCoreDatagram::DatagramSocketOptions.java_class]).call(Java::IoVertxCoreDatagram::DatagramSocketOptions.new(::Vertx::Util::Utils.to_json_object())),::Vertx::DatagramSocket) end raise ArgumentError, "Invalid arguments when calling create_datagram_socket(#{})" end |
- (::Vertx::DnsClient) createDnsClient - (::Vertx::DnsClient) createDnsClient(options) - (::Vertx::DnsClient) createDnsClient(port, host)
201 202 203 204 205 206 207 208 209 210 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/vertx.rb', line 201 def create_dns_client(param_1=nil,param_2=nil) if !block_given? && param_1 == nil && param_2 == nil return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:createDnsClient, []).call(),::Vertx::DnsClient) elsif param_1.class == Hash && !block_given? && param_2 == nil return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:createDnsClient, [Java::IoVertxCoreDns::DnsClientOptions.java_class]).call(Java::IoVertxCoreDns::DnsClientOptions.new(::Vertx::Util::Utils.to_json_object(param_1))),::Vertx::DnsClient) elsif param_1.class == Fixnum && param_2.class == String && !block_given? return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:createDnsClient, [Java::int.java_class,Java::java.lang.String.java_class]).call(param_1,param_2),::Vertx::DnsClient) end raise ArgumentError, "Invalid arguments when calling create_dns_client(#{param_1},#{param_2})" end |
- (::Vertx::HttpClient) create_http_client(options = nil)
151 152 153 154 155 156 157 158 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/vertx.rb', line 151 def create_http_client(=nil) if !block_given? && == nil return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:createHttpClient, []).call(),::Vertx::HttpClient) elsif .class == Hash && !block_given? return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:createHttpClient, [Java::IoVertxCoreHttp::HttpClientOptions.java_class]).call(Java::IoVertxCoreHttp::HttpClientOptions.new(::Vertx::Util::Utils.to_json_object())),::Vertx::HttpClient) end raise ArgumentError, "Invalid arguments when calling create_http_client(#{})" end |
- (::Vertx::HttpServer) create_http_server(options = nil)
140 141 142 143 144 145 146 147 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/vertx.rb', line 140 def create_http_server(=nil) if !block_given? && == nil return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:createHttpServer, []).call(),::Vertx::HttpServer) elsif .class == Hash && !block_given? return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:createHttpServer, [Java::IoVertxCoreHttp::HttpServerOptions.java_class]).call(Java::IoVertxCoreHttp::HttpServerOptions.new(::Vertx::Util::Utils.to_json_object())),::Vertx::HttpServer) end raise ArgumentError, "Invalid arguments when calling create_http_server(#{})" end |
- (::Vertx::NetClient) create_net_client(options = nil)
129 130 131 132 133 134 135 136 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/vertx.rb', line 129 def create_net_client(=nil) if !block_given? && == nil return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:createNetClient, []).call(),::Vertx::NetClient) elsif .class == Hash && !block_given? return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:createNetClient, [Java::IoVertxCoreNet::NetClientOptions.java_class]).call(Java::IoVertxCoreNet::NetClientOptions.new(::Vertx::Util::Utils.to_json_object())),::Vertx::NetClient) end raise ArgumentError, "Invalid arguments when calling create_net_client(#{})" end |
- (::Vertx::NetServer) create_net_server(options = nil)
118 119 120 121 122 123 124 125 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/vertx.rb', line 118 def create_net_server(=nil) if !block_given? && == nil return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:createNetServer, []).call(),::Vertx::NetServer) elsif .class == Hash && !block_given? return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:createNetServer, [Java::IoVertxCoreNet::NetServerOptions.java_class]).call(Java::IoVertxCoreNet::NetServerOptions.new(::Vertx::Util::Utils.to_json_object())),::Vertx::NetServer) end raise ArgumentError, "Invalid arguments when calling create_net_server(#{})" end |
- (::Vertx::WorkerExecutor) create_shared_worker_executor(name = nil, poolSize = nil, maxExecuteTime = nil, maxExecuteTimeUnit = nil)
name. Executors with the same name will share
the same worker pool. The worker pool size , max execute time and unit of max execute time are set when the worker pool is created and
won't change after.The worker pool is released when all the WorkerExecutor sharing the same name are closed.
379 380 381 382 383 384 385 386 387 388 389 390 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/vertx.rb', line 379 def create_shared_worker_executor(name=nil,poolSize=nil,maxExecuteTime=nil,maxExecuteTimeUnit=nil) if name.class == String && !block_given? && poolSize == nil && maxExecuteTime == nil && maxExecuteTimeUnit == nil return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:createSharedWorkerExecutor, [Java::java.lang.String.java_class]).call(name),::Vertx::WorkerExecutor) elsif name.class == String && poolSize.class == Fixnum && !block_given? && maxExecuteTime == nil && maxExecuteTimeUnit == nil return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:createSharedWorkerExecutor, [Java::java.lang.String.java_class,Java::int.java_class]).call(name,poolSize),::Vertx::WorkerExecutor) elsif name.class == String && poolSize.class == Fixnum && maxExecuteTime.class == Fixnum && !block_given? && maxExecuteTimeUnit == nil return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:createSharedWorkerExecutor, [Java::java.lang.String.java_class,Java::int.java_class,Java::long.java_class]).call(name,poolSize,maxExecuteTime),::Vertx::WorkerExecutor) elsif name.class == String && poolSize.class == Fixnum && maxExecuteTime.class == Fixnum && maxExecuteTimeUnit.class == Symbol && !block_given? return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:createSharedWorkerExecutor, [Java::java.lang.String.java_class,Java::int.java_class,Java::long.java_class,Java::JavaUtilConcurrent::TimeUnit.java_class]).call(name,poolSize,maxExecuteTime,Java::JavaUtilConcurrent::TimeUnit.valueOf(maxExecuteTimeUnit.to_s)),::Vertx::WorkerExecutor) end raise ArgumentError, "Invalid arguments when calling create_shared_worker_executor(#{name},#{poolSize},#{maxExecuteTime},#{maxExecuteTimeUnit})" end |
- (void) deploy_verticle(name = nil, options = nil) { ... }
This method returns an undefined value.
Like #deploy_verticle but => Object} are provided to configure the deployment.
298 299 300 301 302 303 304 305 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/vertx.rb', line 298 def deploy_verticle(name=nil,=nil) if name.class == String && true && == nil return @j_del.java_method(:deployVerticle, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(name,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result : nil) } unless !block_given?)) elsif name.class == String && .class == Hash && true return @j_del.java_method(:deployVerticle, [Java::java.lang.String.java_class,Java::IoVertxCore::DeploymentOptions.java_class,Java::IoVertxCore::Handler.java_class]).call(name,Java::IoVertxCore::DeploymentOptions.new(::Vertx::Util::Utils.to_json_object()),(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result : nil) } unless !block_given?)) end raise ArgumentError, "Invalid arguments when calling deploy_verticle(#{name},#{})" end |
- (Set<String>) deployment_i_ds
318 319 320 321 322 323 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/vertx.rb', line 318 def deployment_i_ds if !block_given? return ::Vertx::Util::Utils.to_set(@j_del.java_method(:deploymentIDs, []).call()).map! { |elt| elt } end raise ArgumentError, "Invalid arguments when calling deployment_i_ds()" end |
- (::Vertx::EventBus) event_bus
183 184 185 186 187 188 189 190 191 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/vertx.rb', line 183 def event_bus if !block_given? if @cached_event_bus != nil return @cached_event_bus end return @cached_event_bus = ::Vertx::Util::Utils.safe_create(@j_del.java_method(:eventBus, []).call(),::Vertx::EventBus) end raise ArgumentError, "Invalid arguments when calling event_bus()" end |
- (self) exception_handler { ... }
404 405 406 407 408 409 410 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/vertx.rb', line 404 def exception_handler if true @j_del.java_method(:exceptionHandler, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |event| yield(::Vertx::Util::Utils.from_throwable(event)) unless !block_given? })) return self end raise ArgumentError, "Invalid arguments when calling exception_handler()" end |
- (void) execute_blocking(blockingCodeHandler = nil, ordered = nil) { ... }
This method returns an undefined value.
Safely execute some blocking code.
Executes the blocking code in the handler blockingCodeHandler using a thread from the worker pool.
When the code is complete the handler resultHandler will be called with the result on the original context
(e.g. on the original event loop of the caller).
A Future instance is passed into blockingCodeHandler. When the blocking code successfully completes,
the handler should call the Promise#complete or Promise#complete method, or the Promise#fail
method if it failed.
In the blockingCodeHandler the current context remains the original context and therefore any task
scheduled in the blockingCodeHandler will be executed on the this context and not on the worker thread.
The blocking code should block for a reasonable amount of time (i.e no more than a few seconds). Long blocking operations or polling operations (i.e a thread that spin in a loop polling events in a blocking fashion) are precluded.
When the blocking operation lasts more than the 10 seconds, a message will be printed on the console by the blocked thread checker.
Long blocking operations should use a dedicated thread managed by the application, which can interact with verticles using the event-bus or Context#run_on_context
358 359 360 361 362 363 364 365 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/vertx.rb', line 358 def execute_blocking(blockingCodeHandler=nil,ordered=nil) if blockingCodeHandler.class == Proc && true && ordered == nil return @j_del.java_method(:executeBlocking, [Java::IoVertxCore::Handler.java_class,Java::IoVertxCore::Handler.java_class]).call((Proc.new { |event| blockingCodeHandler.call(::Vertx::Util::Utils.safe_create(event,::Vertx::Promise, nil)) unless blockingCodeHandler == nil }),(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ::Vertx::Util::Utils.from_object(ar.result) : nil) } unless !block_given?)) elsif blockingCodeHandler.class == Proc && (ordered.class == TrueClass || ordered.class == FalseClass) && true return @j_del.java_method(:executeBlocking, [Java::IoVertxCore::Handler.java_class,Java::boolean.java_class,Java::IoVertxCore::Handler.java_class]).call((Proc.new { |event| blockingCodeHandler.call(::Vertx::Util::Utils.safe_create(event,::Vertx::Promise, nil)) unless blockingCodeHandler == nil }),ordered,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ::Vertx::Util::Utils.from_object(ar.result) : nil) } unless !block_given?)) end raise ArgumentError, "Invalid arguments when calling execute_blocking(#{blockingCodeHandler},#{ordered})" end |
- (::Vertx::FileSystem) file_system
172 173 174 175 176 177 178 179 180 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/vertx.rb', line 172 def file_system if !block_given? if @cached_file_system != nil return @cached_file_system end return @cached_file_system = ::Vertx::Util::Utils.safe_create(@j_del.java_method(:fileSystem, []).call(),::Vertx::FileSystem) end raise ArgumentError, "Invalid arguments when calling file_system()" end |
- (::Vertx::Context) get_or_create_context
109 110 111 112 113 114 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/vertx.rb', line 109 def get_or_create_context if !block_given? return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:getOrCreateContext, []).call(),::Vertx::Context) end raise ArgumentError, "Invalid arguments when calling get_or_create_context()" end |
- (true, false) metrics_enabled?
70 71 72 73 74 75 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/vertx.rb', line 70 def metrics_enabled? if !block_given? return @j_del.java_method(:isMetricsEnabled, []).call() end raise ArgumentError, "Invalid arguments when calling metrics_enabled?()" end |
- (true, false) native_transport_enabled?
392 393 394 395 396 397 398 399 400 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/vertx.rb', line 392 def native_transport_enabled? if !block_given? if @cached_is_native_transport_enabled != nil return @cached_is_native_transport_enabled end return @cached_is_native_transport_enabled = @j_del.java_method(:isNativeTransportEnabled, []).call() end raise ArgumentError, "Invalid arguments when calling native_transport_enabled?()" end |
- (::Vertx::TimeoutStream) periodic_stream(delay = nil)
delay milliseconds after
the has been called.
258 259 260 261 262 263 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/vertx.rb', line 258 def periodic_stream(delay=nil) if delay.class == Fixnum && !block_given? return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:periodicStream, [Java::long.java_class]).call(delay),::Vertx::TimeoutStream) end raise ArgumentError, "Invalid arguments when calling periodic_stream(#{delay})" end |
- (void) run_on_context { ... }
This method returns an undefined value.
Puts the handler on the event queue for the current context so it will be run asynchronously ASAP after all preceeding events have been handled.
277 278 279 280 281 282 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/vertx.rb', line 277 def run_on_context if true return @j_del.java_method(:runOnContext, [Java::IoVertxCore::Handler.java_class]).call(Proc.new { yield unless !block_given? }) end raise ArgumentError, "Invalid arguments when calling run_on_context()" end |
- (Fixnum) set_periodic(delay = nil) { ... }
delay milliseconds, at which point handler will be called with
the id of the timer.
248 249 250 251 252 253 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/vertx.rb', line 248 def set_periodic(delay=nil) if delay.class == Fixnum && true return @j_del.java_method(:setPeriodic, [Java::long.java_class,Java::IoVertxCore::Handler.java_class]).call(delay,(Proc.new { |event| yield(event) unless !block_given? })) end raise ArgumentError, "Invalid arguments when calling set_periodic(#{delay})" end |
- (Fixnum) set_timer(delay = nil) { ... }
delay milliseconds, at which point handler will be called with
the id of the timer.
227 228 229 230 231 232 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/vertx.rb', line 227 def set_timer(delay=nil) if delay.class == Fixnum && true return @j_del.java_method(:setTimer, [Java::long.java_class,Java::IoVertxCore::Handler.java_class]).call(delay,(Proc.new { |event| yield(event) unless !block_given? })) end raise ArgumentError, "Invalid arguments when calling set_timer(#{delay})" end |
- (::Vertx::SharedData) shared_data
213 214 215 216 217 218 219 220 221 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/vertx.rb', line 213 def shared_data if !block_given? if @cached_shared_data != nil return @cached_shared_data end return @cached_shared_data = ::Vertx::Util::Utils.safe_create(@j_del.java_method(:sharedData, []).call(),::Vertx::SharedData) end raise ArgumentError, "Invalid arguments when calling shared_data()" end |
- (::Vertx::TimeoutStream) timer_stream(delay = nil)
delay milliseconds after
the has been called.
237 238 239 240 241 242 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/vertx.rb', line 237 def timer_stream(delay=nil) if delay.class == Fixnum && !block_given? return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:timerStream, [Java::long.java_class]).call(delay),::Vertx::TimeoutStream) end raise ArgumentError, "Invalid arguments when calling timer_stream(#{delay})" end |
- (void) undeploy(deploymentID = nil) { ... }
This method returns an undefined value.
Like #undeploy(String) but the completionHandler will be notified when the undeployment is complete.
310 311 312 313 314 315 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/vertx.rb', line 310 def undeploy(deploymentID=nil) if deploymentID.class == String && true return @j_del.java_method(:undeploy, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(deploymentID,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil) } unless !block_given?)) end raise ArgumentError, "Invalid arguments when calling undeploy(#{deploymentID})" end |