You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+17-15
Original file line number
Diff line number
Diff line change
@@ -32,32 +32,32 @@ The most of utility functions of this library accept any type of function to run
32
32
If any function returns an error or panics, the `All` function will terminate immediately and return the error. It'll also send a cancel signal to other uncompleted functions by context if they accept a context by their first parameter.
If you do not want to terminate the execution when some function returns an error or panic, you can try the `AllCompleted` function. The `AllCompleted` function executes until all functions are finished or panic. It'll return a list of the function return values, and an error to indicate whether any functions return error or panic.
The `Parallel` will also be terminated if any function panics or returns an error. If you do not want to terminate the execution of other functions, you can try to use `ParallelCompleted`. The `ParallelCompleted` function will run all functions until all functions are finished. It will return the output list and an error to indicate whether any function errored.
@@ -113,20 +113,22 @@ The `Parallel` will also be terminated if any function panics or returns an erro
113
113
For `Forever` function, you can use it to run a function forever until it returns an error or panics. You need to run the `Forever` function with a `ForeverFn` type function, and you can see more information about `ForeverFn` after the following example.
114
114
115
115
```go
116
-
err:=async.Forever(func(ctx context.Context, next func(context.Context)) error {
117
-
v, ok:= ctx.Value("key")
118
-
ifok {
116
+
err:=Forever(func(ctx context.Context, next func(context.Context)) error {
0 commit comments