Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove static from Procedure and enable more customization #6

Open
ddevault opened this issue Apr 30, 2015 · 6 comments
Open

Remove static from Procedure and enable more customization #6

ddevault opened this issue Apr 30, 2015 · 6 comments

Comments

@ddevault
Copy link
Contributor

I'd like to see static taken off of the Procedure class, but the static methods can remain (backwards compatability and convenience). Then you can instantiate a Procedure object and do some customization on it, like so:

var proc = new Procedure(() => { ... });
proc.Retries = 5;
proc.Timeout = TimeSpan.FromSeconds(30);
proc.Execute();
@ddevault
Copy link
Contributor Author

Furthermore:

var proc = new Procedure<string>(() => { ... });
var breaker = new Hopefully.CircuitBreaker(proc);
var result = breaker.Execute();

Then you could call breaker.Execute() several times.

@StachuDotNet
Copy link

I'd rather have a builder pattern.
Take off static, and you immediately lower the likelihood of an F# dev using this.
Use builder pattern, everyone is happy?

@ddevault
Copy link
Contributor Author

Can you show some example code that demonstrates what you have in mind?

Also, I would prefer to leave the static methods there and continue to extend and maintain the static interface - so in theory F# devs can stick to that and still be happy.

@StachuDotNet
Copy link

Not right now; maybe tonight. Hold off tonight and I'll send a PR?
If I don't send one in 24hrs, then I've forgotten so forget me :)

@ddevault
Copy link
Contributor Author

Sounds good to me, we aren't in a hurry.

@StachuDotNet
Copy link

Cool. Will include some F# samples/tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants