Skip to content

Commit 20b36cc

Browse files
committed
Update commets
1 parent 9483772 commit 20b36cc

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

async.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ func NewExecutor() *Executor {
3636
}
3737

3838
// Register returns a handler to call a method on the receiver.
39-
// The handler should be registered in jobs processor.
39+
// The handler should be registered in a jobs processor.
4040
//
4141
// Method is a func that takes receiver as the first input parameter.
42-
// The next input parameter may optionally be context.Context.
42+
// The next input parameter may optionally be [context.Context].
4343
// It optionally may return an error (or a type implementing error interface).
4444
//
4545
// Receiver should have the same type as the first parameter of the method.
@@ -115,7 +115,7 @@ func (e *Executor) Register( //nolint:gocognit // TODO: simplify
115115

116116
// Prepare returns jobName and marshaled args to be enqueued.
117117
//
118-
// Arguments are serialized to be saved inside jobs storage.
118+
// Arguments are serialized to be saved inside a jobs storage.
119119
// It is a bad practice to use domain types as a transport ones directly.
120120
// So library limits allowed types as much as possible.
121121
// However, it still may be error-prone, see test "using iota is dangerous".

async_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ func TestExecutor(t *testing.T) {
2424
executor := async.NewExecutor()
2525
_, err := executor.Register("job", domainService, DomainService.Struct__MyEnum__Nothing)
2626
require.NoError(t, err)
27-
// Under the hood MyEnumB is converted to `2` and is stored for the future execution.
28-
// If someone adds/removes enum const before MyEnumB, it changes numbering (actual values of enums).
29-
// It means that once job enqueued with argument `2` (meaning MyEnumB) will be executed with argument 2.
30-
// But now it means not MyEnumB, but some different enum const.
27+
// Under the hood [MyEnumB] is converted to `2` and is stored for the future execution.
28+
// If someone adds/removes enum const before [MyEnumB], it changes numbering (actual values of enums).
29+
// It means that once job enqueued with argument `2` (meaning [MyEnumB]) will be executed with argument 2.
30+
// But now it means not [MyEnumB], but some different enum const.
3131
_, args, err := executor.Prepare(DomainService.Struct__MyEnum__Nothing, MyEnumB)
3232
require.NoError(t, err)
3333
assert.JSONEq(t, `{"arg0":2,"type0":"int"}`, string(args))

0 commit comments

Comments
 (0)