You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The local proxies (known also as dummy proxies) enable local API and apps to be used as services hidden behind them. This prevents the clients from easily calling non-interface methods on the service providers (servers). This includes ability to subscribe to server events, receive operations as results and so on. All this also means two-way references - especially when events are exposed by the service interface. For this reason the IManagedInterface and every proxy have the Release() method which destroys the proxy and the references between the two parties kept by it.
To minimize the need to call directly Release way to often we introduced the proxy-container component, carried internally by both LocalAPIClient and AppGate. This enables all the active proxies to be released in a single call to ReleaseAll method supported by both the container and the classes above. Obviously AppGate is auto-released when the app closes, thus freeing all proxies to services the app holds. Under some circumstances AppGate is not convenient or not available (library code, components designed for embedding in other apps and so on.). Using own LocalAPIClient in these cases solves the problem and a container is also available in these cases.
This is all good and we want to keep it that way, but we also optimized the process by preventing the creation of new proxies when one for the same interface and the same server exist in a given container. E.g. When you request a proxy through another (calling a method that returns one) previously obtained through a given LocalAPIClient it will return the same proxy again and again if you happen to request the same service from the same provider/server. Releasing it will release the only such proxy in the container and this can be unexpected.
The above behavior is fine for the overwhelming majority of cases almost fully hiding the non-javascripty need to Release something. However there are scenarios when services are used in large numbers from many servers/providers, but for very short periods of time. This effectively mean their useful lifecycle will very often be the function's body execution. Now the cleanest and way to do something like that will be to create a local LocalAPIClient, get all the services you need , do something and release the whole LocalAPI with its container. It is possible to get individual proxies for individual services, skipping the container, but the procedures needed to do so are obscure and inconvenient.
The idea needed here is how to make such kind of usage possible in a convenient and simple manner that fits well into the normal usage of AppGate and LocalAPIClient. It must remain clearly distinguishable, so that the programmers do not forget to Release the services they request, but they should not use any container and the respective optimizations.
The text was updated successfully, but these errors were encountered:
The local proxies (known also as dummy proxies) enable local API and apps to be used as services hidden behind them. This prevents the clients from easily calling non-interface methods on the service providers (servers). This includes ability to subscribe to server events, receive operations as results and so on. All this also means two-way references - especially when events are exposed by the service interface. For this reason the IManagedInterface and every proxy have the Release() method which destroys the proxy and the references between the two parties kept by it.
To minimize the need to call directly Release way to often we introduced the proxy-container component, carried internally by both LocalAPIClient and AppGate. This enables all the active proxies to be released in a single call to ReleaseAll method supported by both the container and the classes above. Obviously AppGate is auto-released when the app closes, thus freeing all proxies to services the app holds. Under some circumstances AppGate is not convenient or not available (library code, components designed for embedding in other apps and so on.). Using own LocalAPIClient in these cases solves the problem and a container is also available in these cases.
This is all good and we want to keep it that way, but we also optimized the process by preventing the creation of new proxies when one for the same interface and the same server exist in a given container. E.g. When you request a proxy through another (calling a method that returns one) previously obtained through a given LocalAPIClient it will return the same proxy again and again if you happen to request the same service from the same provider/server. Releasing it will release the only such proxy in the container and this can be unexpected.
The above behavior is fine for the overwhelming majority of cases almost fully hiding the non-javascripty need to Release something. However there are scenarios when services are used in large numbers from many servers/providers, but for very short periods of time. This effectively mean their useful lifecycle will very often be the function's body execution. Now the cleanest and way to do something like that will be to create a local LocalAPIClient, get all the services you need , do something and release the whole LocalAPI with its container. It is possible to get individual proxies for individual services, skipping the container, but the procedures needed to do so are obscure and inconvenient.
The idea needed here is how to make such kind of usage possible in a convenient and simple manner that fits well into the normal usage of AppGate and LocalAPIClient. It must remain clearly distinguishable, so that the programmers do not forget to Release the services they request, but they should not use any container and the respective optimizations.
The text was updated successfully, but these errors were encountered: