[Cuis-dev] [QUESTION] Delays after image startup

rabbit rabbit at callistohouse.org
Wed Jul 19 14:26:16 PDT 2023


Hi, as I’ve built an EventualTimer, using a Delay, would you consider a Delay class>>#startUp: resume. On resume, grab the image saved time and diff with each Delays’ expireTime, or whatever, and reschedule the diff. Automatic it’s not a problem. We can think about other stuff.

Liscio come l’olio,
••• rabbit ❤️‍🔥🐰

On Wed, Jul 19, 2023 at 16:06, Gerald Klix via Cuis-dev <[cuis-dev at lists.cuis.st](mailto:On Wed, Jul 19, 2023 at 16:06, Gerald Klix via Cuis-dev <<a href=)> wrote:

> Hi Juan,
>
> thanks for your answer and apologies for my late reply;
> I was on the road again.
>
> Please see below.
>
> On 7/17/23 4:27 PM, Juan Vuletich wrote:
>> On 7/10/2023 7:13 AM, Gerald Klix via Cuis-dev wrote:
>>> Hi all,
>>>
>>> I am a bit hesitant to report this as a defect.
>>>
>>> It looks like that the resumption of
>>> processes stopped by instances of Delay
>>> does not always work after image startup.
>>>
>>> At least for delays that expire during the time
>>> the image was down, if the clock wraps around
>>> midnight. Actually these processes seem to be woken
>>> up at the same time of day, but one day later.
>>>
>>> Is this the expected behavior?
>>>
>>>
>>> Best Regards,
>>>
>>> Gerald
>>
>> I think that all Delays that expired when the image was not running
>> should simply be discarded at startup. Otherwise there is a real risk
>> of the image not starting again, or getting stuck.
>>
> To me this makes sense. Additionally we could get rid of the
> complicated logic in the category snapshotting of class Delay.
> Do you want to terminated the associated processes, too?
>
>> I also think that saving an image with suspended Delays is not a good
>> idea...
>>
> In that case, we can get rid of the delays when saving the image.
> Again the question about the associated processes arises.
>
> The current semantics of delays in saved images is surprising
> and probably unintentional; at least it needs some words
> of explanations in Delay's class comment.
>
> Any how, I implemented Alarms for items in a todo-list with delays.
> The solution for the aforementioned problem is to "reschedule"
> all the alarms when starting the image. "Reschedule" means
> terminated the old process waiting on the delay and create
> a new one, if the alarm still lies in the future.
> Otherwise change the alarm's due time to 5 seconds
> in the future, to alert the user shortly after image startup.
>
> I implemented this behavior using initClassCachedState.
> This way the alarms are rescheduled even when
> I just save the image.
>
> Best Regards,
>
> Gerald
>
> --
> Cuis-dev mailing list
> Cuis-dev at lists.cuis.st
> https://lists.cuis.st/mailman/listinfo/cuis-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20230719/83e1d661/attachment.htm>


More information about the Cuis-dev mailing list