Blocking or synchronizing IHostedService services
Good morning:
I have a project in C# .NET 8 where I have several services (more than 2) IHostedServices running in the background. Each one does something different. My question is how could I block or synchronize the services when one is running? Let me explain: all these services write to the DB and are a bit heavy (4 or 5 seconds…maybe more). My idea is that only one be executed at a time, without priorities, FIFO queue type to avoid any blocking in the DB because they execute very large stored procedures and in some parts they have common tables.
Thanks in advance
Good morning:I have a project in C# .NET 8 where I have several services (more than 2) IHostedServices running in the background. Each one does something different. My question is how could I block or synchronize the services when one is running? Let me explain: all these services write to the DB and are a bit heavy (4 or 5 seconds…maybe more). My idea is that only one be executed at a time, without priorities, FIFO queue type to avoid any blocking in the DB because they execute very large stored procedures and in some parts they have common tables.Thanks in advance Read More