Skip to content

Commit

Permalink
fix: typos
Browse files Browse the repository at this point in the history
  • Loading branch information
vladopajic committed Oct 16, 2024
1 parent 22d7632 commit 648c317
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions actor/combine.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ func (a *combinedActor) onActorStopped() {
// Run stop in goroutine because wrapped actor
// should not wait for other actors to stop.
//
// Also if a.Stop() is called from same gorutine it would
// be recoursive call without exit condition. Therfore
// Also if a.Stop() is called from same goroutine it would
// be recursive call without exit condition. Therefore
// it is need to call a.Stop() from other goroutine,
// regardless of first invariant.
go a.Stop()
Expand Down
6 changes: 3 additions & 3 deletions actor/mailbox.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func NewMailbox[T any](opt ...MailboxOption) Mailbox[T] {
sendHandler = &atomic.Value{}
)

sendHandler.Store(creatPanicHandler[T]("unable to send to a non-started Mailbox"))
sendHandler.Store(createPanicHandler[T]("unable to send to a non-started Mailbox"))

return &mailbox[T]{
actor: New(w),
Expand Down Expand Up @@ -153,7 +153,7 @@ func (m *mailbox[T]) Stop() {
}

m.running = false
m.sendHandler.Store(creatPanicHandler[T]("unable to send to a stopped Mailbox"))
m.sendHandler.Store(createPanicHandler[T]("unable to send to a stopped Mailbox"))
m.actor.Stop()
}

Expand All @@ -162,7 +162,7 @@ func (m *mailbox[T]) Send(ctx Context, msg T) error {
return h(ctx, msg)
}

func creatPanicHandler[T any](msg string) sendHandler[T] {
func createPanicHandler[T any](msg string) sendHandler[T] {
return func(_ Context, _ T) error {
panic(msg) //nolint:forbidigo // panic is intentional
}
Expand Down
6 changes: 3 additions & 3 deletions actor/mailbox_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -275,10 +275,10 @@ func Test_Mailbox_OptEndAferReceivingAll(t *testing.T) {
m.Start()
sendMessages(m)

// This time we start gorotune which will read all messages from mailbox instead of
// This time we start goroutine which will read all messages from mailbox instead of
// stopping in separate goroutine.
// There are no guaranees that this gorutine will finish after Stop is called, so
// it could be the case that this gorotuine has received all messages from mailbox,
// There are no guaranies that this goroutine will finish after Stop is called, so
// it could be the case that this goroutine has received all messages from mailbox,
// even before mailbox was stopped. Which wouldn't correctly assert this feature.
go assertGotAllMessages(m)

Expand Down
2 changes: 1 addition & 1 deletion actor/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func OptOnStop(f func()) Option {

// OptCapacity sets Mailbox queue capacity.
// When `OptAsChan` is used together with `OptCapacity` capacity value
// will set be set to underlaying channel.
// will set be set to underlying channel.
func OptCapacity(capacity int) MailboxOption {
return func(o *options) {
o.Mailbox.Capacity = capacity
Expand Down

0 comments on commit 648c317

Please sign in to comment.