ServerPortfolio  2.0
Python parsers and server
 All Classes Namespaces Files Functions Variables Properties Pages
Public Member Functions | Public Attributes | Static Public Attributes | Private Attributes | List of all members
serverportfolio.AutoParser.Thread_Handle_Queue Class Reference

Thread to handle the queueing system and create the thread_parsers. More...

Inheritance diagram for serverportfolio.AutoParser.Thread_Handle_Queue:
Inheritance graph
[legend]
Collaboration diagram for serverportfolio.AutoParser.Thread_Handle_Queue:
Collaboration graph
[legend]

Public Member Functions

def __init__
 Constructor. More...
 
def __del__
 Contains the threads who will listen to the queue. More...
 
def create_threads_parser
 Create and start the threads, called at initialisation. More...
 
def run
 Fill the queue every TIMEPARSER sec. More...
 
def InsertToQueue
 Function to force an update, insert directly the stock in the queue. More...
 

Public Attributes

 logger
 

Static Public Attributes

tuple update_stock = UpdateStocks( 'InstValue' )
 
tuple all_lines = update_stock.print_dict_stocks('InstValue')
 Important list, a stock should only belongs to one of theses lists ! considered as active: 5 minutes before opening and until closed is detected list of temporarly closed stocks. More...
 

Private Attributes

 _running
 
 _queue_jobs
 

Detailed Description

Thread to handle the queueing system and create the thread_parsers.

Definition at line 233 of file AutoParser.py.

Constructor & Destructor Documentation

def serverportfolio.AutoParser.Thread_Handle_Queue.__init__ (   self)

Constructor.

Size of the FIFO queue set to 10.

Definition at line 237 of file AutoParser.py.

def serverportfolio.AutoParser.Thread_Handle_Queue.__del__ (   self)

Contains the threads who will listen to the queue.

possibility to add an other queue to receive results of the threads... lock problem ?? when update, should not be the same threads Create the parsers and append to _list_thread_parser.

Definition at line 324 of file AutoParser.py.

Member Function Documentation

def serverportfolio.AutoParser.Thread_Handle_Queue.create_threads_parser (   self,
  nb_threads_parser 
)

Create and start the threads, called at initialisation.

Threads set as deamon, stored self.list_thread_parser (should check about problem with deamon)

Parameters
nb_threads_parsernumber of threads to create (NB_THREADS_PARSER)

Definition at line 345 of file AutoParser.py.

References serverportfolio.AutoParser.thread_parser._queue_jobs, and serverportfolio.AutoParser.Thread_Handle_Queue._queue_jobs.

def serverportfolio.AutoParser.Thread_Handle_Queue.InsertToQueue (   self,
  stock,
  action 
)

Function to force an update, insert directly the stock in the queue.

Called by the Server ?
Implement simple lock than the caller must check before returning ?

Parameters
stockname of the stock
actiononly InstValue implemented

Definition at line 456 of file AutoParser.py.

def serverportfolio.AutoParser.Thread_Handle_Queue.run (   self)

Fill the queue every TIMEPARSER sec.

Run until self._running is set to False Check and change the state CLOSED, WAIT_OPEN of the Stocks.

Definition at line 358 of file AutoParser.py.

References serverportfolio.AutoParser.Thread_Handle_Queue._running.

Member Data Documentation

serverportfolio.AutoParser.Thread_Handle_Queue._queue_jobs
private
serverportfolio.AutoParser.Thread_Handle_Queue._running
private

Definition at line 246 of file AutoParser.py.

Referenced by serverportfolio.AutoParser.Thread_Handle_Queue.run().

tuple serverportfolio.AutoParser.Thread_Handle_Queue.all_lines = update_stock.print_dict_stocks('InstValue')
static

Important list, a stock should only belongs to one of theses lists ! considered as active: 5 minutes before opening and until closed is detected list of temporarly closed stocks.

list of open ( or wait_open ) stocks.

Definition at line 301 of file AutoParser.py.

serverportfolio.AutoParser.Thread_Handle_Queue.logger
tuple serverportfolio.AutoParser.Thread_Handle_Queue.update_stock = UpdateStocks( 'InstValue' )
static

Definition at line 258 of file AutoParser.py.


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