public void Divide(int a, int pid, int b, DuplexSubprocess <IDuplexCallback> c) { Console.WriteLine("Divide:{0} / {1} (PID:{2}) (PID:{3})", a, b, pid, c.Id); Task.Delay(1000).ContinueWith(t => c.Callback.Report(a / b)); }
public void Subtract(DuplexSubprocess <IDuplexCallback> c, int a, int b, out int r) { Console.WriteLine("Subtract:{0} - {1} (PID:{2})", a, b, c.Id); Task.Delay(1000).ContinueWith(t => c.Callback.Report(a - b)); r = a - b; }
public void Multipy(int a, DuplexSubprocess <IDuplexCallback> c, int b) { Console.WriteLine("Multipy:{0} * {1} (PID:{2})", a, b, c.Id); Task.Delay(1000).ContinueWith(t => c.Callback.Report(a * b)); }
public int Add(int a, int b, DuplexSubprocess <IDuplexCallback> c) { Console.WriteLine("Add:{0} + {1} (PID:{2})", a, b, c.Id); Task.Delay(1000).ContinueWith(t => c.Callback.Report(a + b)); return(a + b); }