Documentation ¶
Overview ¶
Package concurrency implements a simple channel based ressource manager for concurrent operations.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ResourceManager ¶
ResourceManager is a struct storing a channel of some given ressource (e.g. an [rlwe.Evaluator]) meant to be used concurrently and a channel for errors.
func NewRessourceManager ¶
func NewRessourceManager[T any](ressources []T) *ResourceManager[T]
NewRessourceManager instantiates a new [RessourceManager].
func (*ResourceManager[T]) Run ¶
func (r *ResourceManager[T]) Run(f Task[T])
Run runs a Task concurrently. If the internal error channel is not empty, does nothing. Adds any error returned by Task to the internal error channel.
func (*ResourceManager[T]) Wait ¶
func (r *ResourceManager[T]) Wait() (err error)
Wait waits until all concurrent Task have finished and returns the first encountered error, if any.
Click to show internal directories.
Click to hide internal directories.