A potential fix for #26851
This does change the get_next functionality slightly but if the hook is
already running then the next state should trigger a new one anyway.
And the WC_Action_Queue implementation of WC_Queue_Interface.
This avoids ambiguity between the behaviour of cancel(), which can
be confusing given it technically unschedules all actions for cron
or recurring actions, but only the next instance of a single action.
To more closely align return value with other date APIs in WC, namely
WC_Data. Includes changing return value to:
1. a WC_DateTime instead of a timestamp when a scheduled occurrence is found
2. null instead of false, similar to the default of WC_Data::set_date_prop()
As a wrapper for Action Scheduler. This implements the WC_Queue_Interface
so it can be used as WC core's job queue. Implementing WC_Queue_Interface
also means this class has more generic and appropriate job queue nomenclature
than Action Scheduler itself. For exsample, it provides a method for
non-delayed jobs, i.e. WC_Queue_Interface::add(), unlike Action Scheduler,
which requires scheduling a job for now(), which while fairly simple, is not
intuitive or immediately obvious to new comers.
This makes it both more clear and convenient to use Action Scheduler
as a simple job queue instead of just a queue for delayed jobs.