diff --git a/Fibrous.WPF/Fibrous.WPF.3.0.1-beta.nupkg b/Fibrous.WPF/Fibrous.WPF.3.0.1-beta.nupkg new file mode 100644 index 0000000..979a88d Binary files /dev/null and b/Fibrous.WPF/Fibrous.WPF.3.0.1-beta.nupkg differ diff --git a/Fibrous.WPF/package.nuspec b/Fibrous.WPF/package.nuspec index e9618c6..461ef32 100644 --- a/Fibrous.WPF/package.nuspec +++ b/Fibrous.WPF/package.nuspec @@ -3,7 +3,7 @@ Fibrous.WPF - 3.0.0-beta + 3.0.1-beta Chris Anderson chrisa23 http://github.com/chrisa23/fibrous @@ -12,7 +12,7 @@ Copyright ©2018 CA Anderson LLC concurrency actors multi-threading messaging WPF - + diff --git a/Fibrous/Fibrous.3.0.1-beta.nupkg b/Fibrous/Fibrous.3.0.1-beta.nupkg new file mode 100644 index 0000000..57738a4 Binary files /dev/null and b/Fibrous/Fibrous.3.0.1-beta.nupkg differ diff --git a/Fibrous/IAsyncFiber.cs b/Fibrous/IAsyncFiber.cs index 36d83b9..7eda2b2 100644 --- a/Fibrous/IAsyncFiber.cs +++ b/Fibrous/IAsyncFiber.cs @@ -49,7 +49,39 @@ public interface IAsyncExecutor { Task Execute(Func toExecute); } + public static class AsyncSchedulerExtensions + { + /// + /// Schedule an action at a DateTime + /// + /// + /// + /// + /// + public static IDisposable Schedule(this IAsyncScheduler scheduler, Func action, DateTime when) + { + return scheduler.Schedule(action, when - DateTime.Now); + } + + /// + /// Schedule an action at a DateTime with an interval + /// + /// + /// + /// + /// + /// + public static IDisposable Schedule(this IAsyncScheduler scheduler, Func action, DateTime when, TimeSpan interval) + { + return scheduler.Schedule(action, when - DateTime.Now, interval); + } + + public static IDisposable CronSchedule(this IAsyncScheduler scheduler, Func action, string cron) + { + return new AsyncCronScheduler(scheduler, action, cron); + } + } public static class AsyncFiberExtensions { /// diff --git a/Fibrous/IFiber.cs b/Fibrous/IFiber.cs index 0c70e35..2e5f0f8 100644 --- a/Fibrous/IFiber.cs +++ b/Fibrous/IFiber.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Threading.Tasks; namespace Fibrous { diff --git a/Todo.txt b/Todo.txt index 5e42609..6e4073c 100644 --- a/Todo.txt +++ b/Todo.txt @@ -2,5 +2,4 @@ - better Req/reply tests - add multi producer tests - add queue full tests -- add cron scheduling - clean up ctors to allow injection of schedulers \ No newline at end of file