Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: major refactor for the relay defintions.
Signed-off-by: Andrew Neudegg <andrew.neudegg@finbourne.com>
- Loading branch information
1 parent
e2eee73
commit a9f68c0
Showing
26 changed files
with
265 additions
and
381 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package queue | ||
package _queue | ||
|
||
import ( | ||
"container/list" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package queue | ||
package _queue | ||
|
||
import ( | ||
"testing" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package queue | ||
package _queue | ||
|
||
// Q is a any type of queue, memory, RPC, HTTP, Kafka, etc. | ||
type Q interface { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package relay | ||
package _relay | ||
|
||
import ( | ||
"context" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package relay | ||
package _relay | ||
|
||
import ( | ||
"context" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package _relay | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/andrewneudegg/delta/pkg/events" | ||
) | ||
|
||
// ------------ RELAY ------------- | ||
|
||
// R is the relay interface, all relays should adhere to this. | ||
type R interface { | ||
Do(context.Context, <-chan events.Event) | ||
} | ||
|
||
// ------------ / RELAY ------------- | ||
|
||
// Server will serve events to requesting clients. | ||
type Server interface { | ||
events.Distributor | ||
Start() error // Start the server. | ||
Stop(ctx context.Context) error // Stop the server. | ||
} | ||
|
||
// Client provides clients with a mechanism to access events. | ||
type Client interface { | ||
GetNextEvent() (events.Event, error) // GetNextEvent will return the next available event. | ||
GetNextNEvents(int) ([]events.Event, error) // GetNextNEvents will return up to N next events. | ||
CompleteEvent(events.Event) error // CompleteEvent will complete the underlying event if required. | ||
CompleteNEvents([]events.Event) error // CompleteNEvents will complete N underlying events if required. | ||
FailEvent(events.Event) error // FailEvent will inform the RelayServer that the given event could not be processed. | ||
FailNEvents([]events.Event) error // FailNEvents provides a convenience mechanism for bulk failing events. | ||
EstimateLoad() (int, error) // EstimateLoad provides an estimate for the amount of work being done by this server, between 0 and 100. | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.