Castle.Windsor lifestyle depending on context?

后端 未结 5 967
孤街浪徒
孤街浪徒 2020-12-29 04:44

I have a web application where many components are registered using .LifestylePerWebRequest(), now I\'ve decided to implement Quartz.NET, a .NE

5条回答
  •  悲哀的现实
    2020-12-29 05:34

    Don't use the same components. In fact, in most scenarios I've seen the "background processing" doesn't even make sense to be in the web process to begin with.

    Elaborating based on the comments.

    Shoehorning background processing in the web pipeline is compromising your architecture to save a few $ on a EC2 instance. I would strongly suggest to think about this again, but I digress.

    My statements still stands, even if you're putting both components in the web process they are two different components used in two different contexts and should be treated as such.

提交回复
热议问题