link mem_storage.py from README

Alexandru Pisarenco 5 years ago
parent bf2789eef3
commit ec341afba9

@ -128,7 +128,7 @@ Then go to either of the endpoints:
* http://127.0.0.1:5000/last30m/DJ40J281M584 - list of quotes from the last 30 minutes, grouped by 1 minute intervals, which contain the opening price, closing price, min and max price. * http://127.0.0.1:5000/last30m/DJ40J281M584 - list of quotes from the last 30 minutes, grouped by 1 minute intervals, which contain the opening price, closing price, min and max price.
#### "Hot" stream #### "Hot" stream
Upon inserting every quote value, the value is directed to an in-memory data structure: `alerter.mem_storage` Upon inserting every quote value, the value is directed to an in-memory data structure: alerter/mem_storage.py
Uses a dictionary to organize by symbol. For each symbol there's 2 data structures: Uses a dictionary to organize by symbol. For each symbol there's 2 data structures:
* An ordered (by time) queue of entries. When a new entry is added to the right, old entries are removed from the left as long as they're older than 5 minutes. * An ordered (by time) queue of entries. When a new entry is added to the right, old entries are removed from the left as long as they're older than 5 minutes.

Loading…
Cancel
Save