简体   繁体   中英

Do Azure WebJobs run concurrently on the same host

If I have two distinct WebJobs, both triggered with TimerTrigger and at the same moment in time, can they ever run concurrently on the same host or will one wait for the other to complete?

In other words can a single host run two distinct webjobs in parallel which are triggered via TimerTrigger?

The main reason I am asking is because this project is heavily using both entity framework (DbContext) and also dependency injection and I want to be informed when planning my DI strategy. The solution for me may be challenging if two TimerTrigger webjobs can run concurrently on the same host (because services in this project receive an injected DbContext expecting a unit-of-work lifetime). In this case I might have to synchronize execution of the webjobs (within the same host) myself...

Yes, you can have many webjobs running at the time time. As long as they aren't configured to trigger based on a queue based trigger where an incoming message might cause conflict. You should be fine with a TimerTrigger.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM