Redis context¶
Redis is used for publishing processing events. Message is published to chanel ‘luna-sender:{account_id}’
in format msg_to_luna_sender
.
- class luna_handlers.redis_db.redis_context.RedisContext(host='127.0.0.1', port=6379, password=None, channelName='luna-sender', storageTime=None)[source]¶
Redis context
- async publish(events, requestId)[source]¶
Publish events. Msg is published to channel ‘luna-sender:{account_id}’ in format:
msg_to_luna_sender
- Parameters:
events – events
requestId – request id
- Return type:
None
- async publishRawEvent(event, accountId, handlerId, requestId)[source]¶
Publish events. Msg is published to channel ‘luna-sender:{account_id}’ in format:
msg_to_luna_sender
- Parameters:
event – user raw event
accountId – account id
handlerId – handler id
requestId – request id
- Return type:
None
- class luna_handlers.redis_db.redis_context.SentinelRedisContext(sentinels, masterName, password, channelName='luna-sender', storageTime=None)[source]¶
Redis context for installations with sentinel.
- async publish(events, requestId)[source]¶
Publish events. Msg is published to channel ‘luna-sender:{account_id}’ in format:
msg_to_luna_sender
- Parameters:
events – events
requestId – request id
- Return type:
None