Skip to content

Post a timer without overwrite#17

Open
jayeheffernan wants to merge 2 commits intoenobufs:masterfrom
jayeheffernan:not_exists
Open

Post a timer without overwrite#17
jayeheffernan wants to merge 2 commits intoenobufs:masterfrom
jayeheffernan:not_exists

Conversation

@jayeheffernan
Copy link
Copy Markdown

This adds support to the .post() method to only post the timer if it
doesn't already exist. This is useful for implementing application
logic where the timer must fire after delay milliseconds, or sooner if
the timer was already set (the current behaviour is to always overwrite
and extend the timer). I've added a new parameter, but maintained
backwards compatibility.

I'm using this in my app because I needed it. I don't have any tests,
but thought you might like to consider it anyway.

This adds support to the `.post()` method to only post the timer if it
doesn't already exist.  This is useful for implementing application
logic where the timer must fire after `delay` milliseconds, or sooner if
the timer was already set (the current behaviour is to always overwrite
and extend the timer).
@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage decreased (-0.5%) to 99.522% when pulling 9beb61c on jayeheffernan:not_exists into d37a33e on enobufs:master.

I had the 'NX' option in the wrong place, so that was not working at
all.  I've also broken out the logic for overwriting the delay time and
overwriting the actual message into two separate options.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants