Skip to main content
Version: v1

Summarizer Class

Summarizer is responsible for coordinating when to generate and send summaries. It is the main entry point for summary work. It is created only by summarizing container (i.e. one with clientType === "summarizer")

Signature

export declare class Summarizer extends EventEmitter implements ISummarizer

Extends: EventEmitter

Implements: ISummarizer

Constructors

Constructor Description
(constructor)(url, runtime, configurationGetter, internalsProvider, handleContext, summaryCollection, runCoordinatorCreateFn) Constructs a new instance of the Summarizer class

Static Methods

Method Return Type Description
create(loader, url) Promise<ISummarizer> Creates a Summarizer and its underlying client. Note that different implementations of ILoader will handle the URL differently. ILoader provided by a ContainerRuntime is a RelativeLoader, which will treat URL's starting with "/" as relative to the Container. The general ILoader interface will expect an absolute URL and will not handle "/".
stopReasonCanRunLastSummary(stopReason) boolean Should we try to run a last summary for the given stop reason? Currently only allows "parentNotConnected"

Properties

Property Type Description
enqueueSummarize ISummarizer["enqueueSummarize"]
handle IFluidHandle<this>
IFluidLoadable this
ISummarizer this
summarizeOnDemand ISummarizer["summarizeOnDemand"]
summaryCollection SummaryCollection

Methods

Method Return Type Description
close() void
dispose() void Disposes of resources after running. This cleanup will clear any outstanding timers and reset some of the state properties. Called by ContainerRuntime when it is disposed, as well as at the end the run().
run(onBehalfOf) Promise<SummarizerStopReason>
stop(reason) void Stops the summarizer from running. This will complete the run promise, and also close the container.

Constructor Details

(constructor)

Constructs a new instance of the Summarizer class

Signature

constructor(url: string, 
runtime: ISummarizerRuntime, configurationGetter: () => ISummaryConfiguration,
internalsProvider: ISummarizerInternalsProvider, handleContext: IFluidHandleContext, summaryCollection: SummaryCollection, runCoordinatorCreateFn: (runtime: IConnectableRuntime) => Promise<ICancellableSummarizerController>);

Parameters

Parameter Type Description
url string
runtime ISummarizerRuntime
configurationGetter () => ISummaryConfiguration
internalsProvider ISummarizerInternalsProvider
handleContext IFluidHandleContext
summaryCollection SummaryCollection
runCoordinatorCreateFn (runtime: IConnectableRuntime) => Promise<ICancellableSummarizerController>

Property Details

enqueueSummarize

Signature

readonly enqueueSummarize: ISummarizer["enqueueSummarize"];

Type: ISummarizer["enqueueSummarize"]

handle

Signature

get handle(): IFluidHandle<this>;

Type: IFluidHandle<this>

IFluidLoadable

Signature

get IFluidLoadable(): this;

Type: this

ISummarizer

Signature

get ISummarizer(): this;

Type: this

summarizeOnDemand

Signature

readonly summarizeOnDemand: ISummarizer["summarizeOnDemand"];

Type: ISummarizer["summarizeOnDemand"]

summaryCollection

Signature

readonly summaryCollection: SummaryCollection;

Type: SummaryCollection

Method Details

close

Signature

close(): void;

create

Creates a Summarizer and its underlying client. Note that different implementations of ILoader will handle the URL differently. ILoader provided by a ContainerRuntime is a RelativeLoader, which will treat URL's starting with "/" as relative to the Container. The general ILoader interface will expect an absolute URL and will not handle "/".

Signature

static create(loader: ILoader, url: string): Promise<ISummarizer>;

Parameters

Parameter Type Description
loader ILoader the loader that resolves the request
url string the URL used to resolve the container

Returns

Return type: Promise<ISummarizer>

dispose

Disposes of resources after running. This cleanup will clear any outstanding timers and reset some of the state properties. Called by ContainerRuntime when it is disposed, as well as at the end the run().

Signature

dispose(): void;

run

Signature

run(onBehalfOf: string): Promise<SummarizerStopReason>;

Parameters

Parameter Type Description
onBehalfOf string

Returns

Return type: Promise<SummarizerStopReason>

stop

Stops the summarizer from running. This will complete the run promise, and also close the container.

Signature

stop(reason: SummarizerStopReason): void;

Parameters

Parameter Type Description
reason SummarizerStopReason reason code for stopping

stopReasonCanRunLastSummary

Should we try to run a last summary for the given stop reason? Currently only allows "parentNotConnected"

Signature

static stopReasonCanRunLastSummary(stopReason: SummarizerStopReason): boolean;

Parameters

Parameter Type Description
stopReason SummarizerStopReason SummarizerStopReason

Returns

  • true if the stop reason can run a last summary

Return type: boolean