| Consumer {ipc} | R Documentation |
A Class for reading and executing tasks from a source
Description
A Class for reading and executing tasks from a source
A Class for reading and executing tasks from a source
Public fields
handlersA list of handlers
stoppedIs currently stopped.
laterHandleA callback handle.
Methods
Public methods
Method new()
Creates the object.
Usage
Consumer$new(source)
Arguments
sourceA source, e.g. TextFileSource.
Method setSource()
Sets the source.
Usage
Consumer$setSource(source)
Arguments
sourceA source, e.g. TextFileSource.
Method getSource()
Gets the source.
Usage
Consumer$getSource()
Method consume()
Executes all (unprocessed) signals fired to source from a Producer.
if throwErrors is TRUE, the first error encountered is thrown
after executing all signals. Signals are executed in the env environment.
If env is NULL, the environment set at initialization is used.
Usage
Consumer$consume(throwErrors = TRUE, env = parent.frame())
Arguments
throwErrorsShould errors be thrown or caught.
envThe execution environment.
Method start()
Starts executing consume every millis milliseconds. throwErrors
and env are passed down to consume
Usage
Consumer$start(millis = 250, env = parent.frame())
Arguments
millismilliseconds.
envThe execution environment.
Method stop()
Stops the periodic execution of consume.
Usage
Consumer$stop()
Method addHandler()
Adds a handler for 'signal'. func
Usage
Consumer$addHandler(func, signal)
Arguments
funcThe function which takes three parameters: 1. the signal, 2. the message object, and 3. the evaluation environment.
signalA string to bind the function to.
Method clearHandlers()
Removes all handler.s
Usage
Consumer$clearHandlers()
Method removeHandler()
Removes a single handler.
Usage
Consumer$removeHandler(signal, index)
Arguments
signalThe signal of the handler.
indexThe index of the handler to remove from the signal.
Method initHandlers()
Adds default handlers.
Usage
Consumer$initHandlers()
Method finalize()
cleans up object.
Usage
Consumer$finalize()
Method clone()
The objects of this class are cloneable with this method.
Usage
Consumer$clone(deep = FALSE)
Arguments
deepWhether to make a deep clone.