snews.decider

class snews.decider.Decider(coinc_threshold=10, msg_expiration=120, datetime_format='%y/%m/%d %H:%M:%S', mongo_server='mongodb://localhost:27017/', drop_db=True)[source]
addMessage(message)[source]
Parameters

message – message from a hopskotch kafka stream

Returns

deciding()[source]

Implements the SNEWS coincidence requirement protocol to check cached messages and determine whether an alert message will be sent.

Returns

True or false indicating a coincidence between messages

getAllMessages()[source]

Get all messages in history. :return:

getCacheMessages()[source]

Get messages that have not expired. :return:

class snews.decider.IDecider[source]