-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wip: making progress converting handlers
- Loading branch information
1 parent
394c474
commit 3fdd764
Showing
18 changed files
with
415 additions
and
353 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import {ClientRPCRequestParams, ClientRPCResponseResult} from "@/client/types"; | ||
import { EchoMessage } from "./types"; | ||
import { UnaryCaller } from '../../rpc/callers'; | ||
|
||
|
||
const echo = new UnaryCaller< | ||
ClientRPCRequestParams<EchoMessage>, | ||
ClientRPCResponseResult<EchoMessage> | ||
>(); | ||
|
||
// No type used here, it will override type inference | ||
const clientManifest = { | ||
echo, | ||
} | ||
|
||
export { | ||
clientManifest, | ||
echo, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { UnaryHandler } from "../../rpc/handlers"; | ||
import type { EchoMessage } from './types'; | ||
import {AgentRPCRequestParams, AgentRPCResponseResult} from "../types"; | ||
|
||
class EchoHandler extends UnaryHandler< | ||
{}, | ||
AgentRPCRequestParams<EchoMessage>, | ||
AgentRPCResponseResult<EchoMessage> | ||
> { | ||
public async handle( | ||
input: AgentRPCRequestParams<EchoMessage>, | ||
): Promise<AgentRPCResponseResult<EchoMessage>> { | ||
return { | ||
message: input.message, | ||
} | ||
} | ||
} | ||
|
||
export { EchoHandler }; |
Oops, something went wrong.