worker

package
v0.1.0-alpha Latest Latest
Warning

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

Go to latest
Published: May 19, 2018 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeliveryHTTPClient

func DeliveryHTTPClient(client *http.Client) func(*Delivery)

DeliveryHTTPClient set the default HTTP client to send the document changes.

func DeliveryPusher

func DeliveryPusher(pusher worker.Pusher) func(*Delivery)

DeliveryPusher set the output of the messages.

func DeliveryResourceRepository

func DeliveryResourceRepository(repository flare.ResourceRepositorier) func(*Delivery)

DeliveryResourceRepository set the resource repository.

func DeliverySubscriptionRepository

func DeliverySubscriptionRepository(repository flare.SubscriptionRepositorier) func(*Delivery)

DeliverySubscriptionRepository set the subscription repository.

func PartitionConcurrency

func PartitionConcurrency(concurrency int) func(*Partition)

PartitionConcurrency control the concurrency used to output the result.

func PartitionOutput

func PartitionOutput(output partitionOutputer) func(*Partition)

PartitionOutput is used to receive the output from Partition worker.

func PartitionPusher

func PartitionPusher(pusher worker.Pusher) func(*Partition)

PartitionPusher set the pusher that gonna receive the trigger notifications.

func PartitionResourceRepository

func PartitionResourceRepository(repository flare.ResourceRepositorier) func(*Partition)

PartitionResourceRepository set the repository on Trigger.

func SpreadConcurrency

func SpreadConcurrency(concurrency int) func(*Spread)

SpreadConcurrency set the concurrency to send the output result.

func SpreadOutput

func SpreadOutput(output spreadOutputer) func(*Spread)

SpreadOutput set the output of the result.

func SpreadPusher

func SpreadPusher(pusher worker.Pusher) func(*Spread)

SpreadPusher set the output of the messages.

func SpreadSubscriptionRepository

func SpreadSubscriptionRepository(repository flare.SubscriptionRepositorier) func(*Spread)

SpreadSubscriptionRepository set the subscription repository.

Types

type Delivery

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

Delivery do the heavy lifting by discovering if the given subscription need or not to receive the document.

func (*Delivery) Init

func (d *Delivery) Init(options ...func(*Delivery)) error

Init initialize the Delivery.

func (*Delivery) Process

func (d *Delivery) Process(ctx context.Context, rawContent []byte) error

Process the message.

func (*Delivery) Push

func (d *Delivery) Push(
	ctx context.Context, subscription *flare.Subscription, document *flare.Document, action string,
) error

Push the signal to delivery the document.

type Partition

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

Partition is used to process the signals on documents change.

func (*Partition) Init

func (t *Partition) Init(options ...func(*Partition)) error

Init initialize the Partition.

func (*Partition) Process

func (t *Partition) Process(ctx context.Context, rawContent []byte) error

Process is used to consume the tasks.

func (*Partition) Push

func (t *Partition) Push(ctx context.Context, document *flare.Document, action string) error

Push the document change signal.

type Spread

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

Spread is used to process fetch all the subscriptions of a given partition and generate new messages to be processed.

func (*Spread) Init

func (s *Spread) Init(options ...func(*Spread)) error

Init initialize the Spread.

func (*Spread) Process

func (s *Spread) Process(ctx context.Context, rawContent []byte) error

Process the message.

func (*Spread) Push

func (s *Spread) Push(
	ctx context.Context, document *flare.Document, action, partition string,
) error

Push the signal to process the resource partition.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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