Skip to content

Add maxRoundTripLatency option#953

Merged
davidliu merged 6 commits into
mainfrom
expose-max-round-trip-latency
Jun 1, 2026
Merged

Add maxRoundTripLatency option#953
davidliu merged 6 commits into
mainfrom
expose-max-round-trip-latency

Conversation

@1egoman
Copy link
Copy Markdown
Contributor

@1egoman 1egoman commented May 28, 2026

Exposes a new maxRoundTripLatency parameter on LocalParticipant.performRpc so that a caller can configure the amount of time they'd like to be able to tolerate between a RPC request being enqueued and a RPCRequest's ACK comes back from the remote participant.

I expect this to be a fairly uncommonly tweaked value, but exposing it means that a client can be configured to tolerate situations where RPC requests are backed up behind other messages due to webrtc head of line blocking on the data channel, and RPC requests are timing out before actually being able to be sent via webrtc.

Related swift change: livekit/client-sdk-swift#1023

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 28, 2026

🦋 Changeset detected

Latest commit: 3a7c08c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
client-sdk-android Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

pblazej pushed a commit to livekit/client-sdk-swift that referenced this pull request Jun 1, 2026
Exposes a new `maxRoundTripLatency` parameter on
`LocalParticipant.performRpc` (via a new
`performRpc(destinationIdentity:method:payload:responseTimeout:maxRoundTripLatency:)`
overload) so that a caller can configure the amount of time they'd like
to be able to tolerate between a RPC request being enqueued and a
RPCRequest's ACK comes back from the remote participant.

I expect this to be a fairly uncommonly tweaked value, but exposing it
means that a client can be configured to tolerate situations where RPC
requests are backed up behind other messages due to webrtc head of line
blocking on the data channel, and RPC requests are timing out before
actually being able to be sent via webrtc.

Related android change:
livekit/client-sdk-android#953
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 1, 2026

Diffuse output:

OLD: diffuse-source-file
NEW: livekit-android-sdk-release.aar

 AAR      │ old      │ new      │ diff  
──────────┼──────────┼──────────┼───────
      jar │    4 MiB │    4 MiB │ +91 B 
 manifest │  1.5 KiB │  1.5 KiB │   0 B 
 lint-jar │ 12.7 KiB │ 12.7 KiB │   0 B 
    other │  1.8 KiB │  1.8 KiB │   0 B 
──────────┼──────────┼──────────┼───────
    total │    4 MiB │    4 MiB │ +91 B 

 JAR     │ old   │ new   │ diff       
─────────┼───────┼───────┼────────────
 classes │  2215 │  2215 │  0 (+0 -0) 
 methods │ 42995 │ 42995 │  0 (+5 -5) 
  fields │  8403 │  8404 │ +1 (+1 -0)
AAR
 size  │ diff  │ path          
───────┼───────┼───────────────
 4 MiB │ +91 B │ ∆ classes.jar 
───────┼───────┼───────────────
 4 MiB │ +91 B │ (total)
JAR
METHODS:

   old   │ new   │ diff      
  ───────┼───────┼───────────
   42995 │ 42995 │ 0 (+5 -5) 
  
  + io.livekit.android.room.Room performRpc-eABa9K4(String, String, String, long, long, Continuation) → Object
  + io.livekit.android.room.participant.LocalParticipant performRpc-eABa9K4(String, String, String, long, long, Continuation) → Object
  + io.livekit.android.room.participant.LocalParticipant_performRpc_2 <init>(String, LocalParticipant, long, long, String, String, Continuation)
  + io.livekit.android.room.rpc.RpcManager performRpc-eABa9K4(String, String, String, long, long, Continuation) → Object
  + io.livekit.android.room.rpc.RpcManager_DefaultImpls performRpc-eABa9K4_default(RpcManager, String, String, String, long, long, Continuation, int, Object) → Object
  
  - io.livekit.android.room.Room performRpc-9o0yd6Q(String, String, String, long, Continuation) → Object
  - io.livekit.android.room.participant.LocalParticipant performRpc-9o0yd6Q(String, String, String, long, Continuation) → Object
  - io.livekit.android.room.participant.LocalParticipant_performRpc_2 <init>(String, LocalParticipant, long, String, String, Continuation)
  - io.livekit.android.room.rpc.RpcManager performRpc-9o0yd6Q(String, String, String, long, Continuation) → Object
  - io.livekit.android.room.rpc.RpcManager_DefaultImpls performRpc-9o0yd6Q_default(RpcManager, String, String, String, long, Continuation, int, Object) → Object
  

FIELDS:

   old  │ new  │ diff       
  ──────┼──────┼────────────
   8403 │ 8404 │ +1 (+1 -0) 
  
  + io.livekit.android.room.participant.LocalParticipant_performRpc_2 _maxRoundTripLatency: long

@davidliu davidliu merged commit 3e1296d into main Jun 1, 2026
7 checks passed
@davidliu davidliu deleted the expose-max-round-trip-latency branch June 1, 2026 13:56
@davidliu davidliu mentioned this pull request Jun 1, 2026
1egoman added a commit to livekit/rust-sdks that referenced this pull request Jun 3, 2026
Adds a new `max_round_trip_latency` field to `PerformRpcData`, adding
similar behavior as was added to the corresponding
[swift](livekit/client-sdk-swift#1023) and
[android](livekit/client-sdk-android#953) 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:
```rust
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?;
```

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: lukasIO <mail@lukasseiler.de>
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.

2 participants