Skip to content

Commit

Permalink
forgot handle func and change registerjob channel
Browse files Browse the repository at this point in the history
  • Loading branch information
smonero committed May 3, 2024
1 parent dfaf36a commit b59d996
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions server/neptune/temporalworker/job/noop_stream_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,27 @@ package job

import (
"context"
"sync"
)

type NoopStreamHandler struct{}
type NoopStreamHandler struct {
wg sync.WaitGroup
}

func (n *NoopStreamHandler) RegisterJob(id string) chan string {
return make(chan string)
jobOutput := make(chan string)
n.wg.Add(1)
go func() {
defer n.wg.Done()
for line := range jobOutput {
n.handle(&OutputLine{
JobID: id,
Line: line,
})
}
}()

return jobOutput
}

func (n *NoopStreamHandler) CloseJob(ctx context.Context, jobID string) error {
Expand All @@ -17,3 +32,6 @@ func (n *NoopStreamHandler) CloseJob(ctx context.Context, jobID string) error {
func (n *NoopStreamHandler) CleanUp(ctx context.Context) error {
return nil
}

func (s *NoopStreamHandler) handle(_ *OutputLine) {
}

0 comments on commit b59d996

Please sign in to comment.