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
I guess this might have something todo with generic handling of processes but isn't something like this more typesafe:
public static Unit tell<T>(ProcessId<T> pid, T message, ProcessId sender = default(ProcessId))
public static ProcessId<T> spawn<T>(ProcessName Name, Action<T> Inbox, ...)
Together with making ProcessId implement some (typeless) IProcessId or just allow casting ProcessId to ProcessId this might be compatible with the existing typeless ProcessId system.
(Of course ProcessId could be named ProcessIdTypesafe or anything else.)
So we could have typesafe wiring of actors:
var actorHandler = spawn<string>("my actor", Console.WriteLine);
tell(actorHandler , "hello world"); // compiles
tell(actorHandler, 123); // compile time error
The text was updated successfully, but these errors were encountered:
ProcessId is just the address of the process, and needs to be serialisable. However I was considering having a typed ProcessId as well for convenience within the app.
Probably won't happen soon though, as I'm seriously bogged down with other work at the moment.
Is there a reason for having ProcessId typeless?
I guess this might have something todo with generic handling of processes but isn't something like this more typesafe:
Together with making ProcessId implement some (typeless) IProcessId or just allow casting ProcessId to ProcessId this might be compatible with the existing typeless ProcessId system.
(Of course ProcessId could be named ProcessIdTypesafe or anything else.)
So we could have typesafe wiring of actors:
The text was updated successfully, but these errors were encountered: