Skip to content

Commit 8981b33

Browse files
committed
refactor: introduce TX type for transaction management and update imports across writer modules
Signed-off-by: Vladislav Polyakov <[email protected]>
1 parent fb38d0b commit 8981b33

File tree

8 files changed

+7
-7
lines changed

8 files changed

+7
-7
lines changed

packages/topic/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { Driver } from "@ydbjs/core";
22

33
import { TopicReader, type TopicReaderOptions } from "./reader.js";
4+
import type { TX } from "./tx.js";
45
import { type TopicWriter, type TopicWriterOptions, createTopicTxWriter, createTopicWriter } from "./writer/index.js";
5-
import type { TX } from "./writer/tx.js";
66

77
export interface TopicClient {
88
createReader(options: TopicReaderOptions): TopicReader;
File renamed without changes.

packages/topic/src/writer/_flush.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import type { StreamWriteMessage_FromClient, StreamWriteMessage_WriteRequest_MessageData } from "@ydbjs/api/topic";
22
import type { CompressionCodec } from "../codec.js";
33
import type { PQueue } from "../queue.js";
4+
import type { TX } from "../tx.js";
45
import { _batch_messages } from "./_batch_messages.js";
56
import { _emit_write_request } from "./_write_request.js";
67
import { MAX_INFLIGHT_COUNT } from "./constants.js";
7-
import type { TX } from "./tx.js";
88

99
export function _flush(ctx: {
1010
readonly tx?: TX

packages/topic/src/writer/_init_reponse.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import type { StreamWriteMessage_FromClient, StreamWriteMessage_InitResponse, StreamWriteMessage_WriteRequest_MessageData } from "@ydbjs/api/topic";
22
import type { CompressionCodec } from "../codec.js";
33
import type { PQueue } from "../queue.js";
4+
import type { TX } from "../tx.js";
45
import { _flush } from "./_flush.js";
5-
import type { TX } from "./tx.js";
66

77
export function _on_init_response(ctx: {
88
readonly tx?: TX

packages/topic/src/writer/_write.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import { timestampFromDate } from "@bufbuild/protobuf/wkt";
33
import { type StreamWriteMessage_FromClient, type StreamWriteMessage_WriteRequest_MessageData, StreamWriteMessage_WriteRequest_MessageDataSchema } from "@ydbjs/api/topic";
44
import type { CompressionCodec } from "../codec.js";
55
import type { PQueue } from "../queue.js";
6+
import type { TX } from "../tx.js";
67
import { _flush } from "./_flush.js";
78
import { MAX_PAYLOAD_SIZE } from "./constants.js";
8-
import type { TX } from "./tx.js";
99

1010
export function _write(ctx: {
1111
readonly tx?: TX

packages/topic/src/writer/_write_request.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { create } from "@bufbuild/protobuf";
22
import { Codec, type StreamWriteMessage_FromClient, StreamWriteMessage_FromClientSchema, type StreamWriteMessage_WriteRequest_MessageData } from "@ydbjs/api/topic";
33
import { type CompressionCodec } from "../codec.js";
44
import type { PQueue } from "../queue.js";
5-
import type { TX } from "./tx.js";
5+
import type { TX } from "../tx.js";
66

77
export function _emit_write_request(ctx: {
88
readonly tx?: TX

packages/topic/src/writer/_write_response.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import type { StreamWriteMessage_FromClient, StreamWriteMessage_WriteRequest_MessageData, StreamWriteMessage_WriteResponse } from "@ydbjs/api/topic";
22
import type { CompressionCodec } from "../codec.js";
33
import type { PQueue } from "../queue.js";
4+
import type { TX } from "../tx.js";
45
import { _flush } from "./_flush.js";
5-
import type { TX } from "./tx.js";
66

77
export function _on_write_response(ctx: {
88
readonly tx?: TX

packages/topic/src/writer/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import debug from "debug";
1010

1111
import { type CompressionCodec, defaultCodecMap } from "../codec.js";
1212
import { PQueue } from "../queue.js";
13+
import type { TX } from "../tx.js";
1314
import { _flush } from "./_flush.js";
1415
import { _get_producer_id } from "./_gen_producer_id.js";
1516
import { _on_init_response } from "./_init_reponse.js";
@@ -18,7 +19,6 @@ import { _send_update_token_request } from "./_update_token.js";
1819
import { _write } from "./_write.js";
1920
import { _on_write_response } from "./_write_response.js";
2021
import { MAX_BUFFER_SIZE } from "./constants.js";
21-
import type { TX } from "./tx.js";
2222

2323
export type TopicWriterOptions = {
2424
// Transaction identity.

0 commit comments

Comments
 (0)