Qorus Integration Engine® Enterprise Edition 7.0.6_prod
Loading...
Searching...
No Matches
OMQ::AbstractParallelWriteStream Class Reference

this class handles stream classes that use an I/O thread to send data More...

Inheritance diagram for OMQ::AbstractParallelWriteStream:
[legend]
Collaboration diagram for OMQ::AbstractParallelWriteStream:
[legend]

Public Member Methods

 destructor ()
 waits for any I/O to complete and then returns
 
nothing cleanup ()
 called when the thread resource is still allocated and the thread exits or one of Qore::throw_thread_resource_exceptions() or Qore::throw_thread_resource_exceptions_to_mark() is called
 
 disconnect ()
 Disconnects the connection.
 
 flush ()
 flushes all remote I/O, signals the I/O thread to terminate and waits for confirmation, then checks for background I/O errors, in which case an exception is thrown in this thread
 
- Public Member Methods inherited from OMQ::AbstractParallelStream
 destructor ()
 wait for any I/O in progress to complete
 
nothing cleanupBase ()
 called by child classes when the thread resource is still allocated and the thread exits or one of Qore::throw_thread_resource_exceptions() or Qore::throw_thread_resource_exceptions_to_mark() is called
 
bool inTransaction ()
 Returns True if a remote transaction is in progress.
 
OMQ::StreamInfo getInfo ()
 returns performance information about the stream
 

Private Member Methods

bool terminateIoWaitIntern (string action)
 flushes all remote I/O, signals the I/O thread the terminate and waits for confirmation, then checks for background I/O errors, in which case an exception is thrown in this thread
 
- Private Member Methods inherited from OMQ::AbstractParallelStream
Qore::Thread::Counter cnt ()
 confirmation counter for the socket I/O thread
 
OMQ::StreamInfo m_info ()
 stream information
 
 waitIoComplete ()
 waits for the I/O thread to complete and returns
 
 markIoInProgress ()
 marks the current connection as in progress; must be already checked beforehand that it's not in progress
 
 markIoComplete ()
 performs thread cleanup on the background I/O thread if any is registered and running
 
 checkError (string cmd)
 checks for an error in the background send thread; if there is one, then rethrows the exception in the main application / data thread
 
 startStream ()
 opens the remote transaction by calling startStreamImpl() and starts the background I/O socket thread
 
 socketThread (*ThreadLocalData my_tld)
 sets up thread-local data if possible and calls socketThreadImpl() that implements the background socket I/O for the object
 
 abortIo (string reason)
 signals the end of queue operations
 
bool abortIoWait (string reason)
 signals the end of queue operations and waits until the socket thread terminates
 
 beginTransaction (OMQ::DbStreamConfig m_config)
 starts or continues a remote transaction
 
 commit (OMQ::DbStreamConfig m_config)
 commits a remote transaction
 
 rollback (OMQ::DbStreamConfig m_config)
 rolls back a remote transaction
 

Private:Internal Member Methods

 terminateIoWait (string action)
 flushes all remote I/O, signals the I/O thread the terminate and waits for confirmation, then checks for background I/O errors, in which case an exception is thrown in this thread
 
 stopIoThreadImpl ()
 signal the I/O thread to top sending data
 
bool submitImpl ()
 puts data on the queue for sending in the background I/O thread
 

Additional Inherited Members

- Static Public Member Methods inherited from OMQ::AbstractParallelStream
static staticCleanup ()
 performs static thread resource cleanup on I/O thread resources
 
static checkStream (QorusSystemRestHelper helper, string op)
 checks if there is a stream operation running in the background, if so, a user-friendly exception is thrown
 
- Public Attributes inherited from OMQ::AbstractParallelStream
const DO_DISCONNECT = True
 A constant for rollback() methods to perform real disconnect.
 
const DONT_DISCONNECT = False
 A constant for rollback() methods to keep the network connection alive.
 
- Private Attributes inherited from OMQ::AbstractParallelStream
Qore::Thread::Queue dataq
 Queue for the socket I/O thread.
 
*hash< auto > thread_ex
 exception info for send thread to communicate errors to the primary data thread
 
string objid
 stream object identifier
 
const StreamTerminatedError = "STREAM-TERMINATED"
 stream terminated error
 
const ThreadKey = "_STREAM_"
 thread-local data key
 

Detailed Description

this class handles stream classes that use an I/O thread to send data

such classes have the following characteristics:

  • they can abort the I/O at any time without corrupting the socket data; therefore when aborting the I/O thread, they don't need to disconnect
  • the destructor waits until the I/O thread completes and do not disconnect

Member Function Documentation

◆ flush()

OMQ::AbstractParallelWriteStream::flush ( )

flushes all remote I/O, signals the I/O thread to terminate and waits for confirmation, then checks for background I/O errors, in which case an exception is thrown in this thread

use this method when a remote operation should be continued in the same HTTP connection, for example

◆ submitImpl()

bool OMQ::AbstractParallelWriteStream::submitImpl ( )
private:internal

puts data on the queue for sending in the background I/O thread

Returns
True if the I/O thread is running, False if not

◆ terminateIoWaitIntern()

bool OMQ::AbstractParallelWriteStream::terminateIoWaitIntern ( string  action)
private

flushes all remote I/O, signals the I/O thread the terminate and waits for confirmation, then checks for background I/O errors, in which case an exception is thrown in this thread

called by terminateIoWait()

Returns
True if the I/O thread was terminated due to this call, False if it was already terminated

The documentation for this class was generated from the following file: