Comments (8)
@alexmg, @tillig - any chance of getting this merged and released ?
from autofac.servicefabric.
Hi guys. Sorry, I've been away for the past few weeks and just got back today.
I assume this is to log the exception to another logging framework in addition to any existing ETW events that SF writes.
I think I prefer the RegisterServiceFabricSupport
option to avoid having repeated boilerplate code on all service registrations.
In either case there would be an assumption that the logger implementation is available at the time of service registration (unless exposed using a static API like Serilog's Log
class).
from autofac.servicefabric.
Yep, I see your point @alexmg, I'm cool with RegisterServiceFabricSupport, I'll submit another PR today if you like.
from autofac.servicefabric.
That would be awesome @johnkattenhorn. And thanks @fcastellscha and @EspenG for getting this started.
The new parameter should be optional and have a descriptive name like constructorExceptionCallback
to indicate its scope of use is fairly limited.
We could also consider providing an options type to the RegisterServiceFabricSupport
method with a default implementation that has an empty callback for the ConstructorExceptionCallback
property.
from autofac.servicefabric.
Thinking about it a little, I don't think there will be enough options to warrant a whole new options type.
from autofac.servicefabric.
I pulled in the PR from @EspenG as a starting point for this and then refactored so that the action is provided to the RegisterServiceFabricSupport
instead of each individual service registration.
I also made sure that the lifetime scope is proactively disposed when a constructor exception is thrown because the interceptor won't get the chance to do it.
from autofac.servicefabric.
These changes are currently on the MyGet feed in any 2.1.0
build if you would like to test them.
https://www.myget.org/F/autofac/api/v3/index.json
from autofac.servicefabric.
I need a way to resolve my logger in the callback. The callback is specified when configuring the container builder, but before the container is built. Is it possible to replace the Action<Exception>
with Action<ILifetimeScope, Exception>
. I can then use the ILifetimeScope to resolve my logger.
thanks
from autofac.servicefabric.
Related Issues (20)
- InstancePerMatchingLifetimeScope HOT 2
- Reduced extensibility due to access restrictions in classes and methods HOT 3
- Access denied in RegisterActor HOT 5
- How to communicate to stateful service use remoting? HOT 2
- How to inject custom ActorService HOT 2
- How to use Serilog, Autofac and Service Fabric Actors together HOT 3
- Dynamic Proxy breaks optional constructor arguments
- Cannot create Stateless Service in Service Fabric injecting my own objects in HOT 2
- Service class constructor never invoked
- Lifetime scope for Actor instance HOT 2
- Not support 6.3.187 HOT 1
- Allow use of current ILifetimeScope in the exception callback HOT 1
- ServiceFabricModule is internal, visible to Autofac RegisterAssemblyModules, but cannot be constructed HOT 8
- Message "Access is denied
- Cannot resolve parameter 'System.Fabric.StatefulServiceContext serviceContext' HOT 2
- Singleton does not play nicely with ServiceContext dependency HOT 1
- MissingMethodException after update to Autofac 5.0.0 HOT 1
- Compatibility with Autofac v6 HOT 1
- Allow injecting additional registrations during the creation of service lifetimescope HOT 4
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 autofac.servicefabric.