ServerPortfolio
2.0
Python parsers and server
|
Thread to handle the queueing system and create the thread_parsers. More...
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 | |
Thread to handle the queueing system and create the thread_parsers.
Definition at line 233 of file AutoParser.py.
def serverportfolio.AutoParser.Thread_Handle_Queue.__init__ | ( | self | ) |
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.
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)
nb_threads_parser | number 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 ?
stock | name of the stock |
action | only 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.
|
private |
Definition at line 249 of file AutoParser.py.
Referenced by serverportfolio.AutoParser.Thread_Handle_Queue.create_threads_parser().
|
private |
Definition at line 246 of file AutoParser.py.
Referenced by serverportfolio.AutoParser.Thread_Handle_Queue.run().
|
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 |
Definition at line 241 of file AutoParser.py.
Referenced by serverportfolio.Validation.ValidationTkHP.__init__(), and serverportfolio.SocketServer_Server.MyHandler_Parser.handle().
|
static |
Definition at line 258 of file AutoParser.py.