@resonatehq/kafka
Version:
Resonate Kafka Transport
35 lines • 1.45 kB
TypeScript
import { KafkaJS } from "@confluentinc/kafka-javascript";
import type { ResonateError } from "@resonatehq/sdk/dist/src/exceptions";
import type { Message, MessageSource, Network, Request, ResponseFor } from "@resonatehq/sdk/dist/src/network/network";
export declare class Kafka implements Network, MessageSource {
readonly pid: string;
readonly group: string;
readonly unicast: string;
readonly anycast: string;
private requestPartition;
private responsePartition;
private requestTopic;
private responseTopic;
private producer;
private consumerResponse;
private consumerMessages;
private subscriptions;
private pendingRequests;
constructor({ brokers, group, pid, requestPartition, requestTopic, responsePartition, responseTopic, kafka, }?: {
brokers?: string[];
group?: string;
pid?: string;
requestPartition?: number;
requestTopic?: string;
responsePartition?: number;
responseTopic?: string;
kafka?: KafkaJS.Kafka;
});
start(): Promise<void>;
recv(msg: Message): void;
send<T extends Request>(req: T, callback: (err?: ResonateError, res?: ResponseFor<T>) => void, _headers?: Record<string, string>): Promise<void>;
stop(): Promise<void>;
subscribe(type: "invoke" | "resume" | "notify", callback: (msg: Message) => void): void;
match(target: string): string;
}
//# sourceMappingURL=index.d.ts.map