Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
gitpod-io
GitHub Repository: gitpod-io/gitpod
Path: blob/main/components/gitpod-protocol/src/messaging/handler.ts
2500 views
1
/*
2
* Copyright (C) 2017 TypeFox and others.
3
*
4
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
5
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
6
*/
7
8
import { MessageConnection } from "vscode-jsonrpc";
9
10
export const ConnectionHandler = Symbol("ConnectionHandler");
11
12
export interface ConnectionHandler {
13
readonly path: string;
14
onConnection(connection: MessageConnection, session?: object): void;
15
}
16
17
export interface ConnectionEventHandler {
18
/**
19
* Called when the transport underpinning the connection got closed
20
*/
21
onTransportDidClose(): void;
22
23
/**
24
* Called when the transport underpinning the connection is (re-)opened
25
*/
26
onTransportDidOpen(): void;
27
}
28
29