-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Glacier2Connection for interop with Glacier2 #3608
Comments
Do we actually need to return the actual session proxy returned by Glacier2? Could we instead return a proxy that is valid for the lifetime of the |
We could but would this provide a better API? With |
How do you view the registration of client-side services? With Glacier2, you need to use the randomly assigned client category for the callbacks, which changes with each new session.
I believe the session proxy can remain valid; the new session callback is only required for applications using callbacks. For example, if you send a proxy to the server, it will no longer be valid after you create a new session. |
The application performs all post-session-recreation initialization in the OnNewSession function it registers. Obviously this category mechanism is not well suited to the Router dispatcher and we may need to provide another Router-like dispatcher that is more appropriate for this use-case.
? The session manager that Glacier2 uses (if it uses one) will return a new session service/proxy for each new session/connection. We can return a wrapper that hides this creation/replacement (as Benoit suggested). The question is:
|
That's really an implementation choice / limitation. Since the Glacier2 categories are UUID-like, you could imagine that an old category remains valid even after reconnection. You do however need to "fix" the connection in the fixed proxy held by the server. |
These categories are not valid after the session expires, as glacier2router uses them to forward calls to the appropriate client connection.
I was thinking it could be a regular proxy, There is nothing special about it, you just need to use |
You're right.
It's a regular per session proxy. The session manager (that you configured with the Glacier2 router) can return a UUID service each time Glacier2 calls it. |
See: The way I see it, Glacier2Connection would NOT expose the Glacier2 router proxy at all to the application. This proxy is an implementation detail of Glacier2Connection. The application just needs to configure its server address with: public ServerAddress? ServerAddress { get; set; } // the server address for the Glacier2 router Then, for "callbacks" (= requests sent by servers behind Glacier2 to the client via Glacier2Connection):
This can be a Slice service, a Router, whatever, as usual.
public Func<Glacier2.SessionProxy?, string, Task, Task>? OnNewSession { get; set; } where string = category for this session (see Glacier2::Router::getCategoryFromClient) The OnNewSession registered by the application makes calls to servers (via the Glacier2Connection) to (re)register callbacks (proxies) with remote servers. One difficulty is there is no obvious way to distinguish between these OnNewSession invocations and regular invocations, so: I think a separate initialization phase would be cleaner. The downside of the special invoker is it forces the application to deal with multiple invokers / invocation pipelines. Note that we also need such a special invoker for the session proxy. |
Currently, an IceRPC client cannot talk to a server behind Glacier2. I propose to remove this limitation by implementing a new terminal invoker, Glacier2Connection.
Glacier2Connection is similar to a ClientConnection: it maintains a connection to a Glacier2 router. Unlike ClientConnection, Glacier2Connection also associates and maintains a Glacier2 session with its active protocol connection.
The Glacier2ConnectionOptions would be similar to ClientConnectionOptions, with a few additional properties such as:
We also need to figure out a way to return the session proxies to the application, especially upon reconnection. We could provide an action:
But that's not great if we want to allow the application to perform async calls on this session before the connection is fully connected and the first "InvokeAsync" goes through. So maybe instead:
We could also provide a hook for the protocol connection shutdown. E.g.
The text was updated successfully, but these errors were encountered: