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.63k stars 243 forks source link

Is Coravel good fit for Blazor Server? #369

Closed urza closed 3 months ago

urza commented 3 months ago

Hi, coming from Nicks video about this library, it looks really good, I like how focused and minimal it is. I am interested mostly in scheduler and mailer.

However I noticed some issues here mention having problem with Blazor e.g. https://github.com/jamesmh/coravel/issues/352

So I wanted to ask if it is recommended to use Coravel in Blazor Server apps?

Thanks

jamesmh commented 3 months ago

Unfortunately Microsoft has decided to not support HostedService from a blazor application. As mentioned in #352, there might be some work around but it is not supported in any "official" way 🤷‍♀️.

urza commented 2 months ago

What exactly would that prevent or break with Coravel on Blazor?

I tried a little experiment with blazor on .net 8 and it seems to be working, at least this simple test:

Blazor with Server Inveractivity: Program.cs: image

Result: image

jamesmh commented 2 months ago

I'm not that familiar with the different Blazor models, but I using Coravel from a web server context should work. But, if you are trying to use it inside, let's say, a blazor component -> I think that's where things might break down.

It may be that using a server render mode fixes this too, but I don't know. It's not something that I've tested.

So as long as coravel is used by the web/backend server code then you should be okay. But using Coravel within blazor components - not sure how far you will get.

urza commented 2 months ago

Got it thanks. I will try some experiments with scheduler from blazor pages / components and will update here if I encounter any problems.