VariablenetworkObjectsConst

Network objects are distributed objects within PAPI for TS/JS objects.

https://en.wikipedia.org/wiki/Distributed_object

Objects registered via networkObjectService.set are retrievable using networkObjectService.get.

Function calls made on network objects retrieved via networkObjectService.get are proxied and sent to the original objects registered via networkObjectService.set. All functions on the registered object are proxied except for constructors, dispose, and functions starting with on since those should be events (which are not intended to be proxied) based on our naming convention. If you don't want a function to be proxied, don't make it a property of the registered object.

Functions on a network object will be called asynchronously by other processes regardless of whether the functions are synchronous or asynchronous, so it is best to make them all asynchronous. All shared functions' arguments and return values must be serializable to be called across processes.

When a service registers an object via networkObjectService.set, it is the responsibility of that service, and only that service, to call dispose on that object when it is no longer intended to be shared with other services.

When an object is disposed by calling dispose, all functions registered with the onDidDispose event handler will be called. After an object is disposed, calls to its functions will no longer be proxied to the original object.