Skip to content

Commit 92c1e75

Browse files
committed
revert: handler signature change
1 parent beafe24 commit 92c1e75

File tree

3 files changed

+7
-10
lines changed

3 files changed

+7
-10
lines changed

src/handlers/ClientHandler.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ abstract class ClientHandler<
88
Input extends JSONValue = JSONValue,
99
Output extends JSONValue = JSONValue,
1010
> extends Handler<Container, Input, Output> {
11-
public handle = async function* (
11+
public handle = async (
1212
input: AsyncIterableIterator<Input>,
1313
cancel: (reason?: any) => void,
1414
meta: Record<string, JSONValue> | undefined,
1515
ctx: ContextTimed,
16-
): AsyncIterableIterator<Output> {
16+
): Promise<Output> => {
1717
throw new ErrorRPCMethodNotImplemented();
1818
};
1919
}

src/handlers/RawHandler.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,13 @@ import { ErrorRPCMethodNotImplemented } from '../errors';
66

77
abstract class RawHandler<
88
Container extends ContainerType = ContainerType,
9-
Input extends JSONValue = JSONValue, // Define Input type if needed
10-
Output extends JSONValue = JSONValue, // Define Output type if needed
119
> extends Handler<Container> {
12-
public handle = async function* (
13-
input: AsyncIterableIterator<Input>, // Change this based on your specific needs
10+
public handle = async (
11+
input: [JSONRPCRequest, ReadableStream<Uint8Array>],
1412
cancel: (reason?: any) => void,
1513
meta: Record<string, JSONValue> | undefined,
1614
ctx: ContextTimed,
17-
): AsyncIterableIterator<Output> {
18-
// Change return type to AsyncIterableIterator
15+
): Promise<[JSONValue, ReadableStream<Uint8Array>]> => {
1916
throw new ErrorRPCMethodNotImplemented('This method must be overridden');
2017
};
2118
}

src/handlers/UnaryHandler.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ abstract class UnaryHandler<
88
Input extends JSONValue = JSONValue,
99
Output extends JSONValue = JSONValue,
1010
> extends Handler<Container, Input, Output> {
11-
public handle = async function* (
11+
public handle = async (
1212
input: Input,
1313
cancel: (reason?: any) => void,
1414
meta: Record<string, JSONValue> | undefined,
1515
ctx: ContextTimed,
16-
): AsyncIterableIterator<Output> {
16+
): Promise<Output> => {
1717
throw new ErrorRPCMethodNotImplemented('This method must be overridden');
1818
};
1919
}

0 commit comments

Comments
 (0)