Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Group ¶
func NewGroup ¶
func NewGroup() *Group
NewGroup returns a newly instantiated `Group` object. This instance can collect objects implementing the `algolia.Waitable` interface, including most of the Algolia response objects, and wait for their completion in a concurrent fashion.
func (*Group) Collect ¶
Collect holds references to the given `algolia.Waitable` objects in order to wait for their completion once the `Wait` method will be invoked. Calling `Collect` from multiple goroutines is safe.
func (*Group) Wait ¶
Wait blocks until all the collected `algolia.Waitable` objects have completed. If one of the objects returned an error upon `Wait` invocation, this error is returned. Otherwise, nil is returned. Calling `Wait` from multiple goroutines is safe.
Upon successful completion, the `Group` object can be reused directly to collect other `algolia.Waitable` objects.
type Waitable ¶
type Waitable interface {
Wait() error
}
Waitable represents any asynchronous and potentially long-blocking operation which may eventually fail. Most of Algolia response objects are implementing the `algolia.Waitable` interface in order to wait for their completion using `algolia.NewGroup()` or `algolia.Wait()` provided helpers.