Skip to content

Commit 584f564

Browse files
authored
Allow client to close the agent connection (#209)
## Description Exposes `agent.close()` method. ## Motivation and Context This allows to close the agent. ## Documentation impact - [x] Documentation update required - [ ] Documentation updated [in another PR](_) - [ ] No documentation update required ## Types of changes - [x] Bug fix (non-breaking change which fixes an issue) - [x] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
1 parent a41cbcf commit 584f564

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

packages/js-server-sdk/src/agent.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,10 @@ export class FishjamAgent extends (EventEmitter as new () => TypedEmitter<AgentE
110110
this.client.send(trackData);
111111
}
112112

113+
public disconnect(): void {
114+
this.client.close();
115+
}
116+
113117
private dispatchNotification(message: MessageEvent) {
114118
try {
115119
const data = new Uint8Array(message.data);

0 commit comments

Comments
 (0)