Documentation ¶
Overview ¶
Package parallel use ParallelingWithTimeout to query, and set the timeout
Index ¶
- Variables
- func DoWithTimeout(ctx context.Context, f func() error, timeout time.Duration) (err error)
- type Result
- type TaskFunc
- type Worker
- func (wo *Worker) Add(task TaskFunc) *Worker
- func (wo *Worker) ParallelingWithTimeout(ctx context.Context, timeout time.Duration) (res []Result, err error)
- func (wo *Worker) ParallelingWithTimeoutV2(ctx context.Context, timeout time.Duration) (res []Result, err error)
- func (wo *Worker) ParallelingWithTimeoutV3(ctx context.Context, timeout time.Duration) (res []Result, err error)
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrTimeout = errors.New("service is timeout")
)
Functions ¶
Types ¶
type Worker ¶
type Worker struct {
// contains filtered or unexported fields
}
func (*Worker) ParallelingWithTimeout ¶
func (wo *Worker) ParallelingWithTimeout(ctx context.Context, timeout time.Duration) (res []Result, err error)
ParallelingWithTimeout do the query
Click to show internal directories.
Click to hide internal directories.