Skip to content

Commit

Permalink
Merge pull request #84 from atolab/TS_blogpost_fix
Browse files Browse the repository at this point in the history
Updated TS exammples with new argument parsing and object creation
  • Loading branch information
Charles-Schleich authored Oct 29, 2024
2 parents 13b0afb + 359adf4 commit 3a85646
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions content/blog/2024-10-21-zenoh-firesong.md
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ It is advised for users to account for the general performance characteristics o

Below is an example of a *subscriber* taking a callback:
```ts
const session = await Session.open(Config.new("ws/127.0.0.1:10000"));
const session = await Session.open(new Config("ws/127.0.0.1:10000"));
const callback = async function (sample: Sample): Promise<void> {
console.log!(
">> [Subscriber] Received " +
Expand All @@ -603,15 +603,17 @@ const session = await Session.open(Config.new("ws/127.0.0.1:10000"));

Below is an example of a *publisher*:
```ts
const session = await Session.open(Config.new("ws/127.0.0.1:10000"));
let key_expr = KeyExpr.new("demo/example/zenoh-ts-pub");
const session = await Session.open(new Config("ws/127.0.0.1:10000"));
let key_expr = new KeyExpr("demo/example/zenoh-ts-pub");
let publisher: Publisher = session.declare_publisher(
key_expr,
Encoding.default(),
CongestionControl.BLOCK,
Priority.DATA,
true,
Reliability.RELIABLE
{
encoding: Encoding.default(),
congestion_control: CongestionControl.BLOCK,
priority: Priority.DATA,
express: true,
reliability: Reliability.RELIABLE
}
);
const payload = [122, 101, 110, 111, 104];

Expand Down

0 comments on commit 3a85646

Please sign in to comment.