NetworkManager.NetworkManager Class Reference

Public Member Functions

def abort (self, _)
 
def abort (self, int index)
 
def abort_all (self)
 
def abort_all (self)
 
QtCore.QByteArray blocking_get (self, str _)
 
Optional[QtCore.QByteArray] blocking_get (self, str url)
 
int submit_monitored_get (self, str url)
 
int submit_monitored_request (self, _)
 
int submit_unmonitored_get (self, str url)
 
int submit_unmonitored_request (self, _)
 

Public Attributes

 counting_iterator
 
 diskCache
 
 file_buffers
 
 monitored_queue
 
 QNAM
 
 queue
 
 synchronous_lock
 
 unmonitored_queue
 

Static Public Attributes

 completed
 
 progress_complete
 
 progress_made
 

Detailed Description

A single global instance of NetworkManager is instantiated and stored as
AM_NETWORK_MANAGER. Outside threads should send GET requests to this class by
calling the submit_unmonitored_request() or submit_monitored_request() function,
as needed. See the documentation of those functions for details.
A dummy class to enable an offline mode when the QtNetwork package is not yet installed

Member Function Documentation

◆ abort() [1/2]

def NetworkManager.NetworkManager.abort (   self,
  _ 
)

◆ abort() [2/2]

◆ abort_all() [1/2]

def NetworkManager.NetworkManager.abort_all (   self)
Abort ALL network calls in progress, including clearing the queue

References NetworkManager.NetworkManager.queue.

◆ abort_all() [2/2]

def NetworkManager.NetworkManager.abort_all (   self)

◆ blocking_get() [1/2]

QtCore.QByteArray NetworkManager.NetworkManager.blocking_get (   self,
str  _ 
)

◆ blocking_get() [2/2]

Optional[QtCore.QByteArray] NetworkManager.NetworkManager.blocking_get (   self,
str  url 
)
Submits a GET request to the QNetworkAccessManager and block until it is complete

References NetworkManager.NetworkManager.__create_get_request(), NetworkManager.NetworkManager.__request_queued, NetworkManager.NetworkManager.counting_iterator, NetworkManager.NetworkManager.queue, and NetworkManager.NetworkManager.synchronous_lock.

◆ submit_monitored_get()

int NetworkManager.NetworkManager.submit_monitored_get (   self,
str  url 
)
Adds this request to the queue, and returns an index that can be used by calling code
in conjunction with the progress_made() and progress_completed() signals to handle the
results of the call. All data is cached to disk, and progress is reported periodically
as the underlying QNetworkReply reports its progress. The progress_completed() signal
contains a path to a temporary file with the stored data. Calling code should delete this
file when done with it (or move it into its final place, etc.).

References NetworkManager.NetworkManager.__create_get_request(), NetworkManager.NetworkManager.__request_queued, NetworkManager.NetworkManager.counting_iterator, NetworkManager.NetworkManager.progress_made, and NetworkManager.NetworkManager.queue.

◆ submit_monitored_request()

int NetworkManager.NetworkManager.submit_monitored_request (   self,
  _ 
)

◆ submit_unmonitored_get()

int NetworkManager.NetworkManager.submit_unmonitored_get (   self,
str  url 
)
Adds this request to the queue, and returns an index that can be used by calling code
in conjunction with the completed() signal to handle the results of the call. All data is
kept in memory, and the completed() call includes a direct handle to the bytes returned. It
is not called until the data transfer has finished and the connection is closed.

References NetworkManager.NetworkManager.__create_get_request(), NetworkManager.NetworkManager.__request_queued, NetworkManager.NetworkManager.completed, NetworkManager.NetworkManager.counting_iterator, and NetworkManager.NetworkManager.queue.

◆ submit_unmonitored_request()

int NetworkManager.NetworkManager.submit_unmonitored_request (   self,
  _ 
)

Member Data Documentation

◆ completed

NetworkManager.NetworkManager.completed
static
Initial value:
= QtCore.Signal(
int, int, QtCore.QByteArray
)

Referenced by NetworkManager.NetworkManager.abort(), and NetworkManager.NetworkManager.submit_unmonitored_get().

◆ counting_iterator

◆ diskCache

NetworkManager.NetworkManager.diskCache

◆ file_buffers

NetworkManager.NetworkManager.file_buffers

◆ monitored_queue

NetworkManager.NetworkManager.monitored_queue

◆ progress_complete

NetworkManager.NetworkManager.progress_complete
static
Initial value:
= QtCore.Signal(
int, int, os.PathLike
)

Referenced by NetworkManager.NetworkManager.abort().

◆ progress_made

◆ QNAM

NetworkManager.NetworkManager.QNAM

◆ queue

◆ synchronous_lock

NetworkManager.NetworkManager.synchronous_lock

◆ unmonitored_queue

NetworkManager.NetworkManager.unmonitored_queue

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