Postpone message excution to specific time using RedisMqHost

47 Views Asked by At

Is it possible to use RedisMqServer as simple task scheduler? For example to publish a message and execute it in feature (at specific time)?

1

There are 1 best solutions below

1
mythz On

RedisMQ doesn't provide any explicit support for delayed messages itself, but you could use simulate it with a Timer, e.g:

var sendInMs = 30 * 1000;
new System.Threading.Timer(msg => mqClient.Publish(msg), 
    msg, 
    sendInMs, 
    Timeout.Infinite);