Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithCustomExecutor ¶
func WithCustomExecutor(executor pool.Executor) options.WithOption
WithCustomExecutor sets a custom Executor for the RequestTransactionManager
Types ¶
type CompletionFuture
deprecated
type CompletionFuture interface { pool.CompletionFuture }
Deprecated: don't use it in productive code
type RequestTransaction ¶
type RequestTransaction interface { fmt.Stringer // FailRequest signals that this transaction has failed FailRequest(err error) error // EndRequest signals that this transaction is done EndRequest() error // Submit submits a RequestTransactionRunnable to the RequestTransactionManager Submit(operation RequestTransactionRunnable) // AwaitCompletion wait for this RequestTransaction to finish. Returns an error if it finished unsuccessful AwaitCompletion(ctx context.Context) error // IsCompleted indicates that the that this RequestTransaction is completed IsCompleted() bool }
RequestTransaction represents a transaction
type RequestTransactionManager ¶
type RequestTransactionManager interface { io.Closer // CloseGraceful gives some time opposed to io.Closer CloseGraceful(timeout time.Duration) error // SetNumberOfConcurrentRequests sets the number of concurrent requests that will be sent out to a device SetNumberOfConcurrentRequests(numberOfConcurrentRequests int) // StartTransaction starts a RequestTransaction StartTransaction() RequestTransaction }
RequestTransactionManager handles transactions
func NewRequestTransactionManager ¶
func NewRequestTransactionManager(numberOfConcurrentRequests int, _options ...options.WithOption) RequestTransactionManager
NewRequestTransactionManager creates a new RequestTransactionManager
type RequestTransactionRunnable ¶
type RequestTransactionRunnable func(RequestTransaction)
Click to show internal directories.
Click to hide internal directories.