Simple thread-safe event digester, that conflates "bursty" events that you wish to be alerted to, such as cross-market conditions or latent market data.
More...
Simple thread-safe event digester, that conflates "bursty" events that you wish to be alerted to, such as cross-market conditions or latent market data.
A simple thread-safe design allows 1 event every configurable interval. Allows 1st one through, then conflates.
Member | Description |
_name | Name event or alert |
_tInterval | Interval |
_tAllowed | Time of last allowed event |
_NumAgg | Num conflated |
_mtx | gatea.sys.Thread.Mutex |
def pyRT.gatea.sys.Digest.Digester.__init__ |
( |
|
self, |
|
|
|
name, |
|
|
|
tInterval |
|
) |
| |
Constructor.
- Parameters
-
name | - Name |
tInterval | - Conflation interval |
def pyRT.gatea.sys.Digest.Digester.IsAllowed |
( |
|
self, |
|
|
|
now |
|
) |
| |
Determine we should digest (i.e., conflate)
Call this method every time the digestable event happens:
Return | Allow? | Description |
Non-Zero | YES | Number of events conflated since last time |
Zero | NO | N/A |
- Parameters
-
now | - Current time as Unix Time |
- Returns
- Non-zero if allowed; 0 if not allowed
The documentation for this class was generated from the following file: