dispatcher

package
v0.6.87 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 3, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Handle

func Handle(ctx context.Context, wq workqueue.Interface, concurrency int, f Callback) error

Handle is a synchronous form of HandleAsync.

func Handler

func Handler(wq workqueue.Interface, concurrency int, f Callback) http.Handler

Types

type Callback

type Callback func(ctx context.Context, key string) error

Callback is the function that Handle calls to process a particular key.

func ServiceCallback

func ServiceCallback(client workqueue.WorkqueueServiceClient) Callback

ServiceCallback returns a Callback that invokes the given service.

type Future

type Future func() error

Future is a function that can be used to block on the result of a round of dispatching work.

func HandleAsync

func HandleAsync(ctx context.Context, wq workqueue.Interface, concurrency int, f Callback) Future

HandleAsync initiates a single iteration of the dispatcher, possibly invoking the callback for several different keys. It returns a future that can be used to block on the result.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL