Belle II Software  release-08-01-10
CalculationQueue Class Reference

Public Member Functions

def __init__ (self)
 
def put (self, name, item, **kwargs)
 
def fill_results (self)
 
def get (self, name)
 
def get_keys (self)
 

Public Attributes

 queue
 The multiprocessing queue to handle.
 
 results
 The results to be filled in the end.
 

Detailed Description

This class is a wrapper around a multiprocessing.Queue

It can be used to send and receive values from the modules while processing the calculation.
You can use it to save - for example - filepaths of outputfiles that you create on the fly.
The added items are all of the type CalculationQueueItem.
The CalculationQueue can be used as a dict. After the termination of the underlaying process
you can access the different entries by their names you gave them when putting them on the queue.

Definition at line 19 of file calculation_queue.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self)
Create a queue.

Definition at line 30 of file calculation_queue.py.

30  def __init__(self):
31  """
32  Create a queue.
33  """
34 
35  self.queue = Queue()
36 
37  self.results = dict()
38 

Member Function Documentation

◆ fill_results()

def fill_results (   self)
Fill the internal dict with the information of the queue.
Do not call this on your own.
Do only call this when the underlying process has ended.

Definition at line 46 of file calculation_queue.py.

◆ get()

def get (   self,
  name 
)
Return the item with the given name or an Exception when it is not found.
Do not call this on your own..

Definition at line 59 of file calculation_queue.py.

◆ get_keys()

def get_keys (   self)
Return all possible names of items saved in this queue.
Do not call this on your own.

Definition at line 67 of file calculation_queue.py.

◆ put()

def put (   self,
  name,
  item,
**  kwargs 
)
Put an item on the queue with the given name. Please keep that adding two items with the same name
overrides one of them!

Definition at line 39 of file calculation_queue.py.


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