Skip to content

Commit

Permalink
Support for departure timeout (livekit#150)
Browse files Browse the repository at this point in the history
* Support for departure timeout

* changeset
  • Loading branch information
davidzhao authored Mar 21, 2024
1 parent f216aa8 commit c78658d
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 10 deletions.
5 changes: 5 additions & 0 deletions .changeset/red-cougars-talk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'livekit-server-sdk': patch
---

Support for departure timeout in CreateRoom
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"test:edge": "vitest --environment edge-runtime run"
},
"dependencies": {
"@livekit/protocol": "^1.10.3",
"@livekit/protocol": "^1.12.0",
"camelcase-keys": "^7.0.0",
"jose": "^5.1.2"
},
Expand Down
8 changes: 4 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 10 additions & 5 deletions src/RoomServiceClient.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import type { DataPacket_Kind, TrackInfo } from '@livekit/protocol';
import {
ParticipantInfo,
ParticipantPermission,
Room,
CreateRoomRequest,
DeleteRoomRequest,
ListParticipantsRequest,
Expand All @@ -11,6 +8,9 @@ import {
ListRoomsResponse,
MuteRoomTrackRequest,
MuteRoomTrackResponse,
ParticipantInfo,
ParticipantPermission,
Room,
RoomEgress,
RoomParticipantIdentity,
SendDataRequest,
Expand All @@ -19,7 +19,7 @@ import {
UpdateSubscriptionsRequest,
} from '@livekit/protocol';
import ServiceBase from './ServiceBase.js';
import { livekitPackage, Rpc, TwirpRpc } from './TwirpRPC.js';
import { Rpc, TwirpRpc, livekitPackage } from './TwirpRPC.js';

/**
* Options for when creating a room
Expand All @@ -31,10 +31,15 @@ export interface CreateOptions {
name: string;

/**
* number of seconds the room should clean up after being empty
* number of seconds to keep the room open before any participant joins
*/
emptyTimeout?: number;

/**
* number of seconds to keep the room open after the last participant leaves
*/
departureTimeout?: number;

/**
* limit to the number of participants in a room at a time
*/
Expand Down

0 comments on commit c78658d

Please sign in to comment.