File tree Expand file tree Collapse file tree 2 files changed +25
-23
lines changed
Expand file tree Collapse file tree 2 files changed +25
-23
lines changed Original file line number Diff line number Diff line change 1+ package capabilities
2+
3+ import "time"
4+
5+ // TODO Implement BaseTriggerCapability - CRE-1523
6+
7+ type BaseTriggerCapability struct {
8+ /*
9+ Keeps track of workflow registrations (similar to LLO streams trigger).
10+ Handles retransmits based on T_retransmit and T_max.
11+ Persists pending events in the DB to be resilient to node restarts.
12+ */
13+
14+ retransmitTime time.Duration // time window for an event being ACKd before we retransmit
15+ maxEventTimeout time.Duration // timeout before events are considered lost if not ACKd
16+ }
17+
18+ func (* BaseTriggerCapability ) deliverEvent (event * TriggerEvent , workflowIDs []string ) error {
19+ /*
20+ Base Trigger Capability can interact with the Don2Don layer (in the remote capability setting)
21+ as well as directly with a consumer (in the local setting).
22+ */
23+ return nil // only when the event is successfully persisted and ready to be relaibly delivered
24+ }
Original file line number Diff line number Diff line change @@ -338,34 +338,12 @@ type OCRAttributedOnchainSignature struct {
338338type TriggerExecutable interface {
339339 RegisterTrigger (ctx context.Context , request TriggerRegistrationRequest ) (<- chan TriggerResponse , error )
340340 UnregisterTrigger (ctx context.Context , request TriggerRegistrationRequest ) error
341- AckEvent (ctx context.Context , triggerId string , eventId string ) error
342- }
343-
344- type BaseTriggerCapability interface {
345- /*
346- Keeps track of workflow registrations (similar to LLO streams trigger).
347- Handles retransmits based on T_retransmit and T_max.
348- Persists pending events in the DB to be resilient to node restarts.
349- */
350- deliverEvent (event * TriggerEvent , workflowIDs []string ) error
351- }
352-
353- type BaseTriggerCapabilityImpl struct {
354- // TODO: Every Trigger Capability should use this common implementation
355- }
356-
357- func (* BaseTriggerCapabilityImpl ) deliverEvent (event * TriggerEvent , workflowIDs []string ) error {
358- /*
359- Base Trigger Capability can interact with the Don2Don layer (in the remote capability setting)
360- as well as directly with a consumer (in the local setting).
361- */
362- return nil // only when the event is successfully persisted and ready to be reliably delivered
341+ AckEvent (ctx context.Context , eventId string ) error
363342}
364343
365344// TriggerCapability interface needs to be implemented by all trigger capabilities.
366345type TriggerCapability interface {
367346 BaseCapability
368- BaseTriggerCapability
369347 TriggerExecutable
370348}
371349
You can’t perform that action at this time.
0 commit comments