Skip to content
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

Review API from Revamp PR #107

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Review API from Revamp PR #107

wants to merge 4 commits into from

Conversation

vuplea
Copy link
Collaborator

@vuplea vuplea commented Oct 23, 2024

No description provided.

public sealed class ClientConfig : UiPath.Ipc.EndpointConfig, System.IEquatable<UiPath.Ipc.ClientConfig>
{
public ClientConfig() { }
public string DebugName { get; set; }
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not clear what DebugName does.

Copy link
Collaborator

@eduard-dumitru eduard-dumitru Nov 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a CoreIpc-traditional tagging mechanism for reading logs and understanding who's who.
I didn't like how Name sounded (it seemed more functional than it actually was), so I prefixed it with Debug.

On support/v21.10 the public ones were ListenerSettings.Name and Connection.Name, both of which are public, and which spin off into internals (i.e. ServiceClient inherits the Name from it's associated Listener if it's of the callback sort) and all end up in logs, from hundreds of places, i.e: this

UiPath.Ipc.net6.0-windows.received.txt Outdated Show resolved Hide resolved
{
protected ClientTransport() { }
public abstract UiPath.Ipc.IClientState CreateState();
public abstract void Validate();
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we should think if we really need the Validate feature?

UiPath.Ipc.net6.0-windows.received.txt Outdated Show resolved Hide resolved
public System.TimeSpan RequestTimeout { get; init; }
}
[System.Serializable]
public sealed class EndpointNotFoundException : System.ArgumentOutOfRangeException
Copy link
Collaborator Author

@vuplea vuplea Oct 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not an argument out of range problem

argument out of range is if we could know statically that the argument is outside of the input domain

public abstract class ListenerConfig : UiPath.Ipc.EndpointConfig, System.IEquatable<UiPath.Ipc.ListenerConfig>
{
protected ListenerConfig() { }
public System.Security.Cryptography.X509Certificates.X509Certificate? Certificate { get; init; }
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was this in CoreIpc?
why do we expose this? is it for websocket only?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it was, and it was agnostic than merely websockets;

I was wondering the same thing.

We use CoreIpc over Tcp/Ipc, but I can't find a precise usage for this certificate thing.
We have 0 websocket usage.

[return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("exception")]
public static UiPath.Ipc.Error? FromException(System.Exception? exception) { }
}
public interface IClient
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IClientConnection name would be better:

  • we have the usecase in which we identify the same connection in hashset
  • the callback is only valid for that client connection, not if recreated

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good, but we'll have to discuss whether what you said still holds.

public UiPath.Ipc.IClient Client { get; set; }
[Newtonsoft.Json.JsonIgnore]
public System.TimeSpan RequestTimeout { get; set; }
public TCallbackInterface GetCallback<TCallbackInterface>()
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe it wouldn't be that bad to force the user to go through IClient(Connection) 😓 . it tells you more e.g. how long the callback is valid, but mostly for the reduced surface area.

"your compiler.", true)]
public IpcServer() { }
public UiPath.Ipc.EndpointCollection Endpoints { get; init; }
public System.Collections.Generic.IReadOnlyList<UiPath.Ipc.ListenerConfig> Listeners { get; init; }
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can improve the entity model to have better matching between client and server, and generally to simplify it.
The only real relationship differences I can see:

  • A client has a single connection while a listener has many. I don't see any problem with the API regarding this.
  • A server can have multiple transport configurations "listeners". Of note, we could drop this feature of multiple listeners. A user could simply create more servers calling the same configuration code.

I'd propose this model:
Endpoints = { Client, Server }
Endpoint = (IServiceProvider, Scheduler, RequestTimeout)
Client : Endpoint + (ClientTransport)
Server : Endpoint + (ServerTransport)

}
namespace UiPath.Ipc.Extensibility
{
public interface IListenerConfig<TSelf, TListenerState, TConnectionState>
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IListenerConfig vs ListenerConfig not obvious.
Why other namespace not obvious.
Maybe you'd want to move all transport stuff into UiPath.Ipc.Transport (client included), but I don't see the need.

Too many generics, one of the problems we wanted to avoid.

Copy link
Collaborator

@eduard-dumitru eduard-dumitru Nov 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, and we need to discuss it a bit, but this is exclusively for the select few who will do (maybe) a Blazor JSInterop transport.

"_accepter"})]
public void Start() { }
public System.Threading.Tasks.Task WaitForStart() { }
public System.Threading.Tasks.Task WaitForStop() { }
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what;s the differentce between WaitForStop() and DisposeAsync()?
I'd like to avoid supporting the "restart" scenario.

public System.Threading.Tasks.TaskScheduler? Scheduler { get; set; }
public object? ServiceInstance { get; }
public System.IServiceProvider? ServiceProvider { get; }
public void Validate() { }
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see you've added ServiceProvider and scheduler to IpcBase - so we'd be good to remove them from here, right?

- decommission WaitForStop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants