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:
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
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: