Add Run control event stream
This commit is contained in:
@@ -86,6 +86,7 @@ type Core interface {
|
||||
ListRunEndpoints(domain.RunEndpointFilter) ([]domain.RunEndpoint, error)
|
||||
RegisterRunHello(domain.RunControlHello) (domain.RunControlHelloResult, error)
|
||||
AcceptRunHeartbeat(domain.RunControlHeartbeat) (domain.RunControlHeartbeatResult, error)
|
||||
SubscribeRunControlEvents(domain.RunControlStreamRequest) (RunControlEventSubscription, error)
|
||||
AuthorizeRunRequestSignature(domain.RunRequestSignature) error
|
||||
CreateServerInstance(domain.ServerInstance) (domain.ServerInstance, error)
|
||||
CreateServerInstanceForSession(string, domain.ServerInstance) (domain.ServerInstance, error)
|
||||
@@ -233,6 +234,10 @@ type CoreService struct {
|
||||
controlMu sync.Mutex
|
||||
runSessions map[string]domain.RunControlSession
|
||||
runSessionSeq uint64
|
||||
controlStreamMu sync.Mutex
|
||||
controlStreamSeq map[string]uint64
|
||||
controlStreamEvents map[string]domain.RunControlEvent
|
||||
controlStreamWaiters map[string][]chan domain.RunControlEvent
|
||||
jobMu sync.Mutex
|
||||
jobWaitMu sync.Mutex
|
||||
jobWaiters map[string][]chan struct{}
|
||||
@@ -284,6 +289,9 @@ func newCoreServiceWithLogStore(store repo.Store, logStore LogBodyStore, now fun
|
||||
now: now,
|
||||
authSessions: map[string]string{},
|
||||
runSessions: map[string]domain.RunControlSession{},
|
||||
controlStreamSeq: map[string]uint64{},
|
||||
controlStreamEvents: map[string]domain.RunControlEvent{},
|
||||
controlStreamWaiters: map[string][]chan domain.RunControlEvent{},
|
||||
jobWaiters: map[string][]chan struct{}{},
|
||||
logStore: logStore,
|
||||
logProjectionStates: map[string]map[string]pluginLogSequenceState{},
|
||||
|
||||
Reference in New Issue
Block a user