J John Naylor Active Member Licensed User Longtime User Jan 23, 2023 #1 If I start a receiver to fire every hour.... B4X: Copy Dim t As Long = DateTime.Now + 60 * DateTime.TicksPerMinute 'Fire the next receiver in 60 minutes from now StartReceiverAt (MyReceiver, t, True) how can I test that it has been started? I tried ispaused(myReceiver) but that returns True whether I've done the above code or not (makes sense). I could add a Boolean called Started in the receiver and keep careful tabs on whether it returns true of false but that means I have to explicitly set it. Is there a way I'm missing? Also if the receiver has actually been set, can I cancel it? Again I could get it to be skipped using the boolean value but is there's an easier way...? TIA Last edited: Jan 24, 2023
If I start a receiver to fire every hour.... B4X: Copy Dim t As Long = DateTime.Now + 60 * DateTime.TicksPerMinute 'Fire the next receiver in 60 minutes from now StartReceiverAt (MyReceiver, t, True) how can I test that it has been started? I tried ispaused(myReceiver) but that returns True whether I've done the above code or not (makes sense). I could add a Boolean called Started in the receiver and keep careful tabs on whether it returns true of false but that means I have to explicitly set it. Is there a way I'm missing? Also if the receiver has actually been set, can I cancel it? Again I could get it to be skipped using the boolean value but is there's an easier way...? TIA
Solution Erel Jan 24, 2023 I think that you are confusing "started" with "scheduled". You will need to track the scheduled state. Also remember that the process can be killed and restarted so it needs to be persisted (KVS can help). You can use CancelScheduledService to cancel a scheduled receiver.
I think that you are confusing "started" with "scheduled". You will need to track the scheduled state. Also remember that the process can be killed and restarted so it needs to be persisted (KVS can help). You can use CancelScheduledService to cancel a scheduled receiver.
Erel B4X founder Staff member Licensed User Longtime User Jan 24, 2023 #2 I think that you are confusing "started" with "scheduled". You will need to track the scheduled state. Also remember that the process can be killed and restarted so it needs to be persisted (KVS can help). You can use CancelScheduledService to cancel a scheduled receiver. Upvote 0 Solution
I think that you are confusing "started" with "scheduled". You will need to track the scheduled state. Also remember that the process can be killed and restarted so it needs to be persisted (KVS can help). You can use CancelScheduledService to cancel a scheduled receiver.
J John Naylor Active Member Licensed User Longtime User Jan 24, 2023 #3 Erel said: I think that you are confusing "started" with "scheduled". You will need to track the scheduled state. Also remember that the process can be killed and restarted so it needs to be persisted (KVS can help). You can use CancelScheduledService to cancel a scheduled receiver. Click to expand... Indeed. Thankyou @Erel much appreciated Upvote 0
Erel said: I think that you are confusing "started" with "scheduled". You will need to track the scheduled state. Also remember that the process can be killed and restarted so it needs to be persisted (KVS can help). You can use CancelScheduledService to cancel a scheduled receiver. Click to expand... Indeed. Thankyou @Erel much appreciated