ipc.ts ×8

Frontier kind: Joint frontier

unlabeled · c_28e07c7df154

1 test · 8882 LOC · 37 files · introduces 1 test · 76 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
8 ranges76 lines · 1 files
Tests
1 test

Contains — complete concept membership

All code (extent)
1392 ranges8882 lines · 37 files · Browse complete extent
All tests (intent)
1 testBrowse complete intent

Neighbourhood graph

The orange circle is the focus. Violet and green circles are every ancestor and descendant, broader and narrower, at any distance; blue squares and pink diamonds are the introduced files and exact introduced tests of every visible concept, not only the focus's. Arrows point from broader to narrower concepts and bridge only concepts omitted from this view. Undirected links show source or test introduction. Concept and file size follows LOC; exact test nodes use test-count units.

Introduced files, introduced tests, and structurally relevant concept specialization

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the native relationship evidence on this page.

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the native relationship evidence on this page while the interactive map is unavailable.

Native relationship evidence

Every exact file and test below is linked only from the concept that introduces it.

Introduced tests

Every collected test enters the hierarchy at exactly one concept.

1 test introduced at this concept.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

1 file ranked by introduced lines: 76 introduced LOC across 8 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/base/parts/ipc/common/ipc.ts 76 introduced LOC · 8 ranges

Open complete file

690 doRequest();
691 } else {
692 > uninitializedPromise = createCancelablePromise(_ => this.whenInitialized()); ipc.ts
693 > uninitializedPromise.then(() => {
694 > uninitializedPromise = null;
695 > doRequest();
696 > });
697 > }
698 },
699 onDidRemoveLastListener: () => {
865
866 connectionDisposables.add(onDidClientDisconnect(() => {
867 > channelServer.dispose(); ipc.ts
868 > channelClient.dispose();
869 > this._connections.delete(connection);
870 > this._onDidRemoveConnection.fire(connection);
871 > this.disposables.delete(connectionDisposables);
872 > connectionDisposables.dispose();
873 }));
874 });
889 getChannel<T extends IChannel>(channelName: string, clientFilter: (client: Client<TContext>) => boolean): T;
890 getChannel<T extends IChannel>(channelName: string, routerOrClientFilter: IClientRouter<TContext> | ((client: Client<TContext>) => boolean)): T {
891 > const that = this; ipc.ts
892 >
893 > // eslint-disable-next-line local/code-no-dangerous-type-assertions
894 > return {
895 > call(command: string, arg?: any, cancellationToken?: CancellationToken): Promise<T> {
896 let connectionPromise: Promise<Client<TContext>>;
897
915 .call(command, arg, cancellationToken);
916 },
917 > listen(event: string, arg: any): Event<T> { ipc.ts
918 > if (isFunction(routerOrClientFilter)) {
919 > return that.getMulticastEvent(channelName, routerOrClientFilter, event, arg);
920 > }
921
922 const channelPromise = routerOrClientFilter.routeEvent(that, event, arg)
925 return getDelayedChannel(channelPromise)
926 .listen(event, arg);
927 > } ipc.ts
928 > } as T;
929 > }
930
931 private getMulticastEvent<T extends IChannel>(channelName: string, clientFilter: (client: Client<TContext>) => boolean, eventName: string, arg: any): Event<T> {
932 > const that = this; ipc.ts
933 > let disposables: DisposableStore | undefined;
934 >
935 > // Create an emitter which hooks up to all clients
936 > // as soon as first listener is added. It also
937 > // disconnects from all clients as soon as the last listener
938 > // is removed.
939 > const emitter = new Emitter<T>({
940 > onWillAddFirstListener: () => {
941 > disposables = new DisposableStore();
942 >
943 > // The event multiplexer is useful since the active
944 > // client list is dynamic. We need to hook up and disconnection
945 > // to/from clients as they come and go.
946 > const eventMultiplexer = new EventMultiplexer<T>();
947 > const map = new Map<Connection<TContext>, IDisposable>();
948 >
949 > const onDidAddConnection = (connection: Connection<TContext>) => {
950 > const channel = connection.channelClient.getChannel(channelName);
951 > const event = channel.listen<T>(eventName, arg);
952 > const disposable = eventMultiplexer.add(event);
953 >
954 > map.set(connection, disposable);
955 > };
956 >
957 > const onDidRemoveConnection = (connection: Connection<TContext>) => {
958 > const disposable = map.get(connection);
959 >
960 > if (!disposable) {
961 return;
962 }
963 > ipc.ts
964 > disposable.dispose();
965 > map.delete(connection);
966 > };
967 >
968 > that.connections.filter(clientFilter).forEach(onDidAddConnection);
969 > Event.filter(that.onDidAddConnection, clientFilter)(onDidAddConnection, undefined, disposables);
970 > that.onDidRemoveConnection(onDidRemoveConnection, undefined, disposables);
971 > eventMultiplexer.event(emitter.fire, emitter, disposables);
972 >
973 > disposables.add(eventMultiplexer);
974 > },
975 > onDidRemoveLastListener: () => {
976 > disposables?.dispose();
977 > disposables = undefined;
978 > }
979 > });
980 > that.disposables.add(emitter);
981 >
982 > return emitter.event;
983 > }
984
985 registerChannel(channelName: string, channel: IServerChannel<TContext>): void {
1036
1037 registerChannel(channelName: string, channel: IServerChannel<TContext>): void {
1038 > this.channelServer.registerChannel(channelName, channel); ipc.ts
1039 > }
1040
1041 dispose(): void {