Skip to content

Add max round trip latency#1127

Merged
1egoman merged 16 commits into
mainfrom
add-max-round-trip-latency
Jun 3, 2026
Merged

Add max round trip latency#1127
1egoman merged 16 commits into
mainfrom
add-max-round-trip-latency

Conversation

@1egoman
Copy link
Copy Markdown
Contributor

@1egoman 1egoman commented Jun 2, 2026

Adds a new max_round_trip_latency field to PerformRpcData, adding similar behavior as was added to the corresponding swift and android pull requests.

Note that this is a breaking api change. Per @ladvoc's guidance, this was deemed to be ok because there isn't really a great way to add this new field to the PerformRpcData struct in a backwards compatible way.

Given this is a breaking change, I opted to break it in a way where if we have to add more fields in here in the future, it could be done in a non breaking way by making PerformRpcData use a builder pattern. That results in something that looks like:

let output = caller_room.local_participant().perform_rpc(
    PerformRpcData::new("identity", "method") // <-- New builder
        .with_payload("payload")
        .with_response_timeout(Duration::from_secs(5))
).await?;

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 2, 2026

Changeset

The following package versions will be affected by this PR:

Package Bump
livekit minor
livekit-ffi patch

@github-actions github-actions Bot requested a review from lukasIO as a code owner June 2, 2026 21:17
Comment thread examples/rpc/src/main.rs Outdated
Comment thread livekit/src/room/rpc/mod.rs Outdated
Comment thread .changeset/add_max_round_trip_latency.md Outdated
@1egoman
Copy link
Copy Markdown
Contributor Author

1egoman commented Jun 3, 2026

@ladvoc Before merging, any preference on with_payload(payload: impl Into<String>) versus with_payload(payload: impl ToString)?

The benefit of the latter is something like a serde value just works (ie, with_payload(json!({ hello: "world" }))), but the con is there's an extra copy involved.

@ladvoc
Copy link
Copy Markdown
Contributor

ladvoc commented Jun 3, 2026

The benefit of the latter is something like a serde value just works (ie, with_payload(json!({ hello: "world" }))), but the con is there's an extra copy involved.

I would go with impl Into<String> to avoid the extra copy and to maintain consistency with other APIs.

@1egoman 1egoman merged commit 2434b45 into main Jun 3, 2026
25 of 26 checks passed
@1egoman 1egoman deleted the add-max-round-trip-latency branch June 3, 2026 16:40
@knope-bot knope-bot Bot mentioned this pull request Jun 3, 2026
1egoman pushed a commit that referenced this pull request Jun 3, 2026
> [!IMPORTANT]
> Merging this pull request will create these releases

# livekit 0.7.44 (2026-06-03)
## Features

- Add rpc max_round_trip_latency and move to builder pattern - #1127
(@1egoman)

## Fixes

- [allow(dead_code)] for dead function in room module - #1128
(@stephen-derosa)
- Send publisher offer with join request to accelerate connection - #996
(@cnderrauber)
# livekit-api 0.5.1 (2026-06-03)
## Fixes

- Send publisher offer with join request to accelerate connection - #996
(@cnderrauber)
# livekit-ffi 0.12.62 (2026-06-03)
## Fixes

- Add rpc max_round_trip_latency and move to builder pattern - #1127
(@1egoman)
- [allow(dead_code)] for dead function in room module - #1128
(@stephen-derosa)
- Send publisher offer with join request to accelerate connection - #996
(@cnderrauber)

Co-authored-by: knope-bot[bot] <152252888+knope-bot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants