File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -58,12 +58,26 @@ type BaseTriggerCapability struct {
5858 wg sync.WaitGroup
5959}
6060
61- func (b * BaseTriggerCapability ) SetSend (fn OutboundSend ) { b .send = fn }
62- func (b * BaseTriggerCapability ) SetLostHook (h LostHook ) { b .lost = h }
63- func (b * BaseTriggerCapability ) SetStore (s EventStore ) { b .store = s }
64- func (b * BaseTriggerCapability ) SetTiming (retry , max time.Duration ) {
65- b .tRetransmit = retry
66- b .tMax = max
61+ func NewBaseTriggerCapability (
62+ store EventStore ,
63+ send OutboundSend ,
64+ lost LostHook ,
65+ lggr logger.Logger ,
66+ tRetransmit , tMax time.Duration ,
67+ ) * BaseTriggerCapability {
68+ ctx , cancel := context .WithCancel (context .Background ())
69+
70+ return & BaseTriggerCapability {
71+ store : store ,
72+ send : send ,
73+ lost : lost ,
74+ lggr : lggr ,
75+ tRetransmit : tRetransmit ,
76+ tMax : tMax ,
77+ pending : make (map [string ]* PendingEvent ),
78+ ctx : ctx ,
79+ cancel : cancel ,
80+ }
6781}
6882
6983// If you want logs:
You can’t perform that action at this time.
0 commit comments