Class: Sol::GuiCommunication
- Inherits:
-
Object
- Object
- Sol::GuiCommunication
- Defined in:
- lib/webview/sol.rb
Overview
A Service is a non-visual component encapsulating the information required to perform some work on one or more background threads. As part of the JavaFX UI library, the Service knows about the JavaFX Application thread and is designed to relieve the application developer from the burden of manging multithreaded code that interacts with the user interface. As such, all of the methods and state on the Service are intended to be invoked exclusively from the JavaFX Application thread.
Service implements Worker. As such, you can observe the state of the background operation and optionally cancel it. Service is a reusable Worker, meaning that it can be reset and restarted. Due to this, a Service can be constructed declaratively and restarted on demand.
If an Executor is specified on the Service, then it will be used to actually execute the service. Otherwise, a daemon thread will be created and executed. If you wish to create non-daemon threads, then specify a custom Executor (for example, you could use a ThreadPoolExecutor with a custom ThreadFactory).
Because a Service is intended to simplify declarative use cases, subclasses should expose as properties the input parameters to the work to be done. For example, suppose I wanted to write a Service which read the first line from any URL and returned it as a String. Such a Service might be defined, such that it had a single property, url.
GuiCommunication establishes a communication channel from the ruby script and the JavaFX Application.
Instance Method Summary (collapse)
Instance Method Details
- (Object) createTask
243 244 245 |
# File 'lib/webview/sol.rb', line 243 def createTask ReadBuffer.new end |