Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: JSON-RPC responses async iterable iterator #1937

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chore: update demos to use JSON-RPC responses async iterator
tien committed Aug 14, 2024

Verified

This commit was signed with the committer’s verified signature.
tien Tiến Nguyễn Khắc
commit 6dc862987e2eb9c66301be03663e2d154d0752f5
3 changes: 1 addition & 2 deletions wasm-node/javascript/demo/demo-deno.ts
Original file line number Diff line number Diff line change
@@ -69,8 +69,7 @@ while(true) {

(async () => {
try {
while(true) {
const response = await chain.nextJsonRpcResponse();
for await (const response of chain.jsonRpcResponses) {
socket.send(response);
}
} catch(_error) {}
6 changes: 2 additions & 4 deletions wasm-node/javascript/demo/demo.mjs
Original file line number Diff line number Diff line change
@@ -162,8 +162,7 @@ wsServer.on('connection', function (connection, request) {

(async () => {
try {
while(true) {
const response = await para.nextJsonRpcResponse();
for await (const response of para.jsonRpcResponses) {
connection.send(response);
}
} catch(_error) {}
@@ -177,8 +176,7 @@ wsServer.on('connection', function (connection, request) {

(async () => {
try {
while(true) {
const response = await relay.nextJsonRpcResponse();
for await (const response of relay.jsonRpcResponses) {
connection.send(response);
}
} catch(_error) {}
Loading