Skip to content

Commit

Permalink
Add Explicit Reciever, resolves issue issues/63
Browse files Browse the repository at this point in the history
  • Loading branch information
Charles-Schleich committed Dec 23, 2024
1 parent 6e60166 commit 42f2b6c
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions zenoh-ts/examples/deno/src/z_get_liveliness.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
//

import {
RingChannel, deserialize_string, Sample, Config, Subscriber, Session, KeyExpr,
SampleKind,
deserialize_string, Sample, Config, Session, KeyExpr,
Receiver,
RecvErr,
ReplyError
Expand All @@ -29,12 +28,8 @@ export async function main() {
let key_expr = new KeyExpr("group1/**");
console.log("Sending Liveliness Query '", key_expr.toString(),"'");

let receiver = session.liveliness().get(key_expr, {timeout: seconds.of(20)});

if (!(receiver instanceof Receiver)){
return // Return in case of callback get query
}

let receiver : Receiver= session.liveliness().get(key_expr, {timeout: seconds.of(20)}) as Receiver;

let reply = await receiver.receive();

while (reply != RecvErr.Disconnected) {
Expand Down

0 comments on commit 42f2b6c

Please sign in to comment.