| StreamHandler | R Documentation |
Stream Handler R6 Class
Stream Handler R6 Class
Manages streaming responses from Goose
processThe processx process object
bufferAccumulated response buffer
callbackChunk callback function
error_callbackError callback function
complete_callbackCompletion callback function
max_timeMaximum runtime in seconds (Inf = no limit)
idle_timeoutMaximum time in seconds without output (Inf = no limit) Initialize stream handler
new()StreamHandler$new(callback, error_callback, complete_callback)
callbackFunction to call with chunks
error_callbackFunction for errors
complete_callbackFunction for completion Start streaming process
start()StreamHandler$start( query, session_id = NULL, max_time = Inf, idle_timeout = Inf )
queryThe query to execute
session_idOptional session ID
max_timeNumeric, maximum runtime in seconds (Inf = no limit)
idle_timeoutNumeric, maximum time in seconds without output (Inf = no limit) Monitor streaming process
monitor()Internal loop that reads stdout/stderr, parses chunks, and enforces
max_time / idle_timeout.
Get accumulated buffer
StreamHandler$monitor()
get_response()StreamHandler$get_response()
Complete response text Stop streaming
stop()Kill the underlying streaming process if it is still running.
StreamHandler$stop()
clone()The objects of this class are cloneable with this method.
StreamHandler$clone(deep = FALSE)
deepWhether to make a deep clone.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.