Question

Unclear if there are ccr gurus here but let's try anyway.

I have this function in my code:

dq.EnqueueTimer(TimeSpan.FromMilliseconds(TIMEOUT), timeOutFn);

which will call my function after the timeout. However since I need this timer on a lot of open sockets, I would like to pass a parameter(or ID) to the timer function.

How do you do this?

Thanks

R

Was it helpful?

Solution

Something like this should do it.

var timerPort = new Port<DateTime>();
dq.EnqueueTimer(TimeSpan.FromMilliseconds(TIMEOUT), timerPort);
timerPort.Receive(ignored => MyFunc(myParam));
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top