archivists

package
v0.0.0-...-07b9e35 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2021 License: OSL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClipsArchivist

type ClipsArchivist struct {
	Errors <-chan error
	Done   <-chan struct{}
}

A ClipsArchivist looks for clips that have been supplied by an upstream clip curator, and places new clips into the collection.

func StartClipsArchivist

func StartClipsArchivist(ctx context.Context, queue messagebus.Receiver, db datastore.DataStorer) *ClipsArchivist

StartClipsArchivist initializes a clips archivist. The archvist will begin polling the supplied queue for new clips, and will place those clips in the supplied datastore. The clips archivist operates indefinitely, or until its parent context signals that it is done. Once the archivist is initialized, the resulting API.Errors and API.Done channels can be monitored. The caller may safely exit only when the Errors and Done channels have closed.

type CompletedResearchArchivist

type CompletedResearchArchivist struct {
	Errors <-chan error
	Done   <-chan struct{}
}

A CompletedResearchArchivist determines if any upstream researchers have reported any completed work, and, if so, records thwat work in the datastore and renews the lease on the associated episode.

func StartCompletedResearchArchivist

func StartCompletedResearchArchivist(ctx context.Context, messageBus messagebus.SenderReceiver, db datastore.DataStorer) *CompletedResearchArchivist

StartCompletedResearchArchivist starts the archivist, which begins polling for completed work. When completed work is found, it is recorded in the datastore and the associated episode's lease is renewed. This archivist will continue to poll for completed work until it determines that no work is available, at which point the archivist will exit and no further work will be done. Thus, it is the responsibility of the host system to periodically start an archivist via a cron job or some other desired scheduler.

type EpisodesArchivist

type EpisodesArchivist struct {
	Errors <-chan error
	Done   <-chan struct{}
}

An EpisodesArchivist looks for episodes that have been supplied by an upstream episode curator, and places new episodes into the collection.

func StartEpisodesArchivist

func StartEpisodesArchivist(ctx context.Context, queue messagebus.Receiver, db datastore.DataStorer) *EpisodesArchivist

StartEpisodesArchivist initializes an episode archivist. The archvist will begin polling the supplied queue for new episodes, and will place those episodes in the supplied datastore. The archivist operates indefinitely, or until its parent context signals that it is done. Once the archivist is initialized, the resulting API.Errors and API.Done channels can be monitored. The caller may safely exit only when the Errors and Done channels have closed.

type PendingResearchArchivist

type PendingResearchArchivist struct {
	Errors <-chan error
	Done   <-chan struct{}
}

A PendingResearchArchivist determines if any research work should be done, and, if so, produces a pending-work-item for a downstream researcher to act upon.

func StartPendingResearchArchivist

func StartPendingResearchArchivist(ctx context.Context, messageBus messagebus.Sender, db datastore.DataStorer) *PendingResearchArchivist

StartPendingResearchArchivist starts the archivist, which attempts to create pending work-items for downstream researchers to consume.

An archivist's host should expect the archivist to exit when the archivist has determined that no overhead is available to queue more work. It is the host's responsibility to initialize the archivist periodically to check if work needs to be queued. This can be done via an automated cron job or other scheduler as desired.

Jump to

Keyboard shortcuts

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