jamesmh / coravel

Near-zero config .NET library that makes advanced application features like Task Scheduling, Caching, Queuing, Event Broadcasting, and more a breeze!
https://docs.coravel.net/Installation/
MIT License
3.92k stars 257 forks source link

Task scheduling does not work in .NET Maui #334

Closed ahmed527 closed 1 year ago

ahmed527 commented 1 year ago

Describe the bug Since Maui (previously Xamarin) is part of .NET platform, I expected Coravel Task Scheduling to work, but it is not. I tried different combinations of the configuration options but still had the same outcome. The configuration is similar to a Web API configuration as below:

   public class MyFirstInvocable : IInvocable 
    {
        public Task Invoke()
        {
            Console.WriteLine("This is my first invocable!");
            return Task.CompletedTask;
        }
    } 
 builder.Services.AddScheduler();
        builder.Services.AddTransient<MyFirstInvocable>();

        var app = builder.Build();

        var provider = app.Services;
        provider.UseScheduler(scheduler =>
        {

            scheduler
              .Schedule<MyFirstInvocable>()
              .EverySeconds(2)
              .Weekday();
        });

Affected Coravel Feature Scheduling

Expected behaviour I expect the debugger hits my break point inside MyFirstInvocable . I tried without invocable as well.

I appreciate any help.

Thank you

jamesmh commented 1 year ago

I don't think MAUI supports BackgroundService and HostedService so Coravel won't work. See this open issue.

jrahma commented 1 year ago

I have the same problem.