composer

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Composer

type Composer struct {
	// contains filtered or unexported fields
}

func New

func New(depGraph map[string][]string, waiter core.Waiter) *Composer

New creates and returns a new instance of Composer. It takes depGraph of type map[string][]string which represents the dependency graph, and waiter of type core.Waiter which is used to manage synchronization. It returns a pointer to a Composer struct initialized with the provided depGraph and waiter.

func (*Composer) Compose

func (c *Composer) Compose() (map[string]any, error)

Compose waits for all requests to finish and then returns the composed result. It does not take any parameters. It returns a map[string]any containing the composed result and an error if any occurred during composition. It returns an error if there was an issue during the composition process.

func (*Composer) Prepare added in v0.1.0

func (c *Composer) Prepare(ctx context.Context, name string, parser handler.Parser) (reqID string, depsResults map[string]any, err error)

Prepare initializes and prepares a request by composing dependencies and parsing the response. It takes a context.Context, a string name, and a handler.Parser. It returns an int64 request ID, a map of dependency results, and an error if the dependencies cannot be composed or the response cannot be parsed. It returns an error if the dependencies cannot be composed or the response cannot be parsed.

Jump to

Keyboard shortcuts

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