Comments (12)
I can only agree with the other participants here and your solution. Queue-bound microservices e.g. do not rely on ASP.NET Core but for example its nice IHostBuilder
component instead of the IWebHostBuilder
interface. Also there is no Startup
class in that case.
Other projects like Serilog
utilize additional NuGet packages to create a more native feeling for dedicated frameworks like ASP.NET Core Serilog.AspNetCore
.
Thanks for your work.
from coravel.
Great - thanks @tthiery and @IonRobu for the awesome feedback! I'll aim to publish the changes later today
from coravel.
This might also fix another concern I'm having with another piece I'm building...
Thanks for the feedback @IonRobu !
It's great having people able to give some more insight / alternative scenarios.
from coravel.
Maybe IApplicationBuilder extension methods from Registration classes should be rewritten as IServiceCollection or IServiceProvider extensions methods?
from coravel.
I'll do some investigation and get back to you. My initial thought is that the Application piece is needed due to the way the internal services are tied right into the DI container, which let's Coravel use DI etc.
I'll let you know.
P.S. any specific feature that you need in a shared project?
Thanks!
from coravel.
The scenario is perfect in asp.net core applications, but the middle ("business") layer referring the Coravel package may be also used in non-web scenario, so I think the Microsoft.AspNetCore.App reference should not be there.
from coravel.
What pieces of Coravel would you use in that scenario?
from coravel.
For the moment, I use cache, but I intend to integrate also scheduler, queueing, events
from coravel.
I think converting to IServiceProvider might be promising. I def cannot use IServiceCollection since Coravel needs access to the provider to "rig" stuff up.
I'll let you know when I've got some more progress made 👍
from coravel.
Playing around right now, here's the quick and dirty version.I removed the non-abstract dep. on AspNetCore and kept the very specific pieces I need - but using the appropriate "abstractions" reference. Here's what that would look like:
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="2.1.0"/>
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="2.1.0"/>
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="2.1.0"/>
Already, build times are extremely faster too since it's not bringing in that entire ecosystem.
So either way this is promising 👍
What do you think about these dependencies?
from coravel.
Playing around right now, here's the quick and dirty version.I removed the non-abstract dep. on AspNetCore and kept the very specific pieces I need - but using the appropriate "abstractions" reference. Here's what that would look like:
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="2.1.0"/> <PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="2.1.0"/> <PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="2.1.0"/>
Already, build times are extremely faster too since it's not bringing in that entire ecosystem.
So either way this is promising
What do you think about these dependencies?
I think is very good. Also, @tthiery's proposed pattern is a good one - having framework-specific "extension" packages
from coravel.
Coravel nuget 1.9.0 should be available. Release Notes here
Thanks @tthiery and @IonRobu ! Let me know how things work out.
from coravel.
Related Issues (20)
- Runtime error on valid (non-standard) cron expressions HOT 2
- Using an ICancellableInvocable in a dotnet 6 program HOT 2
- Add support to TimeSpan HOT 1
- Do works before app shut down? HOT 1
- Running at Last day of Month? HOT 1
- Queue not being invoked on console app
- CLI not working with .NET 6 HOT 2
- Throw an exception and potentially prevent app on startup if a scheduled IInvocable is not available in the IoC container HOT 3
- Registering event listeners that are not configured causes silent exceptions HOT 1
- ScheduleInvocableType Cron method not working with .NET 6 HOT 1
- ScheduleWithParams not working with DI HOT 3
- Coravel Background Service HOT 9
- Add global from to Mailing docs HOT 3
- Calling From() in Build() to override globalFrom in Mailing HOT 2
- How much schedule Tasks could be run for an application? HOT 1
- Is it possible to run the tasks one after the other? HOT 2
- Add support for IAsyncDisposable HOT 3
- Make global timer configureable
- Run() isn't invoking method HOT 2
- Task scheduling does not work in .NET Maui HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from coravel.