RIOT icon indicating copy to clipboard operation
RIOT copied to clipboard

event_periodic_callback: add event_periodic_callback_oneshot()

Open benpicco opened this issue 1 year ago • 3 comments

Contribution description

Often there is a need to execute an event once after a delay. This adds a convenience helper function for it.

Testing procedure

A test for the new function has been added to tests/sys/event_periodic_callback

Issues/PRs references

benpicco avatar Sep 11 '24 13:09 benpicco

Murdock results

:heavy_check_mark: PASSED

bef6232ed4ef62ab80cb2833633333e1ae1724ae tests/event_periodic_callback: add test for oneshot event

Success Failures Total Runtime
10196 0 10197 15m:10s

Artifacts

riot-ci avatar Sep 11 '24 13:09 riot-ci

I'm not too familiar with the details of the different event queue APIs, but the naming event_periodic_callback_onshot() sounds confusing. I would expect to be an event either periodic or oneshot :P

mguetschow avatar Sep 16 '24 15:09 mguetschow

I'm not too familiar with the details of the different event queue APIs, but the naming event_periodic_callback_onshot() sounds confusing. I would expect to be an event either periodic or oneshot :P

I would not expect a periodic event to count but somehow it does looks a bit going a egg-laying-wool-milk-pig attempt to events which are not events but tasks that are parsed by workers named event threads

I think the naming of and the actual implementation is quiet fitting

kfessel avatar Sep 25 '24 18:09 kfessel

I agree that this is confusing, we can do much better simply by not trying to stack too much on top of each other - see #21219

benpicco avatar Feb 15 '25 22:02 benpicco