File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -36,10 +36,10 @@ func NewExecutor() *Executor {
36
36
}
37
37
38
38
// 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.
40
40
//
41
41
// 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] .
43
43
// It optionally may return an error (or a type implementing error interface).
44
44
//
45
45
// 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
115
115
116
116
// Prepare returns jobName and marshaled args to be enqueued.
117
117
//
118
- // Arguments are serialized to be saved inside jobs storage.
118
+ // Arguments are serialized to be saved inside a jobs storage.
119
119
// It is a bad practice to use domain types as a transport ones directly.
120
120
// So library limits allowed types as much as possible.
121
121
// However, it still may be error-prone, see test "using iota is dangerous".
Original file line number Diff line number Diff line change @@ -24,10 +24,10 @@ func TestExecutor(t *testing.T) {
24
24
executor := async .NewExecutor ()
25
25
_ , err := executor .Register ("job" , domainService , DomainService .Struct__MyEnum__Nothing )
26
26
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.
31
31
_ , args , err := executor .Prepare (DomainService .Struct__MyEnum__Nothing , MyEnumB )
32
32
require .NoError (t , err )
33
33
assert .JSONEq (t , `{"arg0":2,"type0":"int"}` , string (args ))
You can’t perform that action at this time.
0 commit comments