Skip to content

Commit

Permalink
Rename Start method Run (#4) (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
efritz authored May 1, 2023
1 parent d73cc61 commit 79b5583
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func (w *Worker) Init(ctx context.Context) error {
return w.spec.Init(ctx)
}

func (w *Worker) Start(ctx context.Context) (err error) {
func (w *Worker) Run(ctx context.Context) (err error) {
if finalizer, ok := w.spec.(nacelle.Finalizer); ok {
defer func() {
finalizeErr := finalizer.Finalize(ctx)
Expand Down
16 changes: 8 additions & 8 deletions worker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func TestRunAndStop(t *testing.T) {
assert.Nil(t, err)

go func() {
errChan <- worker.Start(ctx)
errChan <- worker.Run(ctx)
}()

eventually(t, receiveStruct(tickChan))
Expand Down Expand Up @@ -97,7 +97,7 @@ func TestNonStrict(t *testing.T) {
assert.Nil(t, err)

go func() {
errChan <- worker.Start(ctx)
errChan <- worker.Run(ctx)
}()

clock.BlockingAdvance(time.Minute)
Expand Down Expand Up @@ -178,7 +178,7 @@ func TestStrict(t *testing.T) {
assert.Nil(t, err)

go func() {
errChan <- worker.Start(ctx)
errChan <- worker.Run(ctx)
}()

clock.BlockingAdvance(time.Second * 57)
Expand Down Expand Up @@ -279,7 +279,7 @@ func TestFinalize(t *testing.T) {
assert.Nil(t, err)

go func() {
errChan <- worker.Start(ctx)
errChan <- worker.Run(ctx)
}()

worker.Stop(ctx)
Expand All @@ -306,7 +306,7 @@ func TestFinalizeError(t *testing.T) {
assert.Nil(t, err)

go func() {
errChan <- worker.Start(ctx)
errChan <- worker.Run(ctx)
}()

worker.Stop(ctx)
Expand Down Expand Up @@ -337,7 +337,7 @@ func TestFinalizeErrorDoesNotOverwrite(t *testing.T) {
assert.Nil(t, err)

go func() {
errChan <- worker.Start(ctx)
errChan <- worker.Run(ctx)
}()

worker.Stop(ctx)
Expand All @@ -364,7 +364,7 @@ func TestTickError(t *testing.T) {
assert.Nil(t, err)

go func() {
errChan <- worker.Start(ctx)
errChan <- worker.Run(ctx)
}()

value := readErrorValue(t, errChan)
Expand All @@ -390,7 +390,7 @@ func TestTickContext(t *testing.T) {
assert.Nil(t, err)

go func() {
errChan <- worker.Start(ctx)
errChan <- worker.Run(ctx)
}()

worker.Stop(ctx)
Expand Down

0 comments on commit 79b5583

Please sign in to comment.