Skip to content

Commit ee759f8

Browse files
committed
ts: added better documentation
1 parent 1073d33 commit ee759f8

File tree

4 files changed

+592
-798
lines changed

4 files changed

+592
-798
lines changed

typescript-sdk/src/index.ts

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ import {
4545
} from "./types";
4646
import { FumaroleSM } from "./runtime/state-machine";
4747
import { downloadSlotObserverFactory, GrpcSlotDownloader } from "./runtime/grpc-slot-downloader";
48-
import { DownloadTaskArgs, DownloadTaskResult, fumaroleObservable, FumaroleRuntimeArgs, RuntimeEvent } from "./runtime/runtime";
48+
import { DownloadTaskArgs, DownloadTaskResult, fumaroleObservable, FumaroleRuntimeArgs, RuntimeEvent } from "./runtime/reactive_runtime";
4949
import { firstValueFrom, from, Observable, Observer, share, Subject } from "rxjs";
5050
import { createDeferred } from "./utils/promise";
5151
import { makeObservable } from "./utils/grpc_ext";
@@ -140,24 +140,39 @@ export class FumaroleClient {
140140
});
141141
}
142142

143+
/**
144+
* Establish a Dragonsouth-like consumption stream from a persistent subscriber.
145+
*
146+
* @param persistentSubscriberName The name of the persistent subscriber to connect to.
147+
* @param request the initial `SubscribeRequest` to use.
148+
* @returns an observable that emits updates from the subscriber.
149+
*/
143150
async dragonsmouthSubscribe(
144-
consumerGroupName: string,
151+
persistentSubscriberName: string,
145152
request: SubscribeRequest,
146153
): Promise<Observable<SubscribeUpdate>> {
147154
return this.dragonsmouthSubscribeWithConfig(
148-
consumerGroupName,
155+
persistentSubscriberName,
149156
request,
150157
getDefaultFumaroleSubscribeConfig(),
151158
);
152159
}
153160

161+
/**
162+
* Establish a Dragonsouth-like consumption stream from a persistent subscriber.
163+
*
164+
* @param persistentSubscriberName The name of the persistent subscriber to connect to.
165+
* @param initialSubscribeRequest The initial `SubscribeRequest` to use.
166+
* @param config An instance of `FumaroleSubscribeConfig` configuration options for the subscription.
167+
* @returns an observable that emits updates from the subscriber.
168+
*/
154169
public async dragonsmouthSubscribeWithConfig(
155-
consumerGroupName: string,
170+
persistentSubscriberName: string,
156171
initialSubscribeRequest: SubscribeRequest,
157172
config: FumaroleSubscribeConfig,
158173
): Promise<Observable<SubscribeUpdate>> {
159-
160-
const initialJoin: JoinControlPlane = { consumerGroupName };
174+
175+
const initialJoin: JoinControlPlane = { consumerGroupName: persistentSubscriberName };
161176
const initialJoinCommand: ControlCommand = { initialJoin };
162177
const controlPlaneCommandSubject = new Subject<ControlCommand>();
163178
const fumaroleRuntimeEventSubject = new Subject<RuntimeEvent>();

typescript-sdk/src/runtime/grpc-slot-downloader.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
FumaroleClient,
66
} from "../grpc/fumarole";
77
import { SubscribeUpdate } from "../grpc/geyser";
8-
import { DownloadBlockErrorKind, DownloadTaskArgs, DownloadTaskResult } from "./runtime";
8+
import { DownloadBlockErrorKind, DownloadTaskArgs, DownloadTaskResult } from "./reactive_runtime";
99
import { Observer } from "rxjs";
1010
import { LOGGER } from "../logging";
1111

0 commit comments

Comments
 (0)