Arduino icon indicating copy to clipboard operation
Arduino copied to clipboard

[Breaking] New polledtimeout

Open devyte opened this issue 4 years ago • 3 comments

Fixes #7903

This PR restructures the polledtimeout code by separating the templates from the policies, which makes it easier for users to understand how to extend the code with new custom policies. It also separates* the generic policies that should be common to all Arduino cores from the policies that are specific to the esp8266.

The namespaces and template name have been changed to uppercase based on multiple feedback received since the frist version was implemented.

As usual, the specifics are up for discussion.

  • Restructure polledtimeout
  • simplify namespaces
  • rename across code
    • new methods remaining(), elapsed(), getters

devyte avatar Apr 04 '21 13:04 devyte

Thanks ! Is it a strong breaking change or do you plan to add something like this, for users who would have made the effort to use it ?

namespace esp8266
{
    using  polledTimeout = ::PolledTimeout [[ deprecated, "use PolledTimeout instead of esp8266::polledTimeout" ]];
}

This fixes #7903

d-a-v avatar Apr 05 '21 14:04 d-a-v

Is it a strong breaking change or do you plan to add something like this, for users who would have made the effort to use it ?

namespace esp8266
{
    using  polledTimeout = ::PolledTimeout [[ deprecated, "use PolledTimeout instead of esp8266::polledTimeout" ]];
}

I intend this to be a strong breaking change. I don't want the legacy naming to be dragged into the future.

devyte avatar Apr 06 '21 00:04 devyte

@devyte The copyright header is AWOL in PolledTimeout.h, the three newly added files seem OK in this regard.

dok-net avatar Apr 07 '21 08:04 dok-net