Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 21:29
    Aaronontheweb commented #3863
  • 21:28
    Aaronontheweb synchronize #3863
  • 21:18
    Aaronontheweb synchronize #4000
  • 21:17
    Aaronontheweb commented #3964
  • 21:17
    Aaronontheweb commented #3964
  • 21:16
    Aaronontheweb synchronize #3964
  • 21:12
    Aaronontheweb commented #3964
  • 21:08
    Aaronontheweb synchronize #71
  • 21:04
    Aaronontheweb synchronize #3973
  • 21:00
    Aaronontheweb commented #71
  • 20:58

    Aaronontheweb on dev

    Akka.Persistence.TCK fix - chec… (compare)

  • 20:58
    Aaronontheweb closed #4002
  • 20:51
    Aaronontheweb synchronize #4002
  • 20:45
    Aaronontheweb commented #3811
  • 20:45
    Aaronontheweb commented #3811
  • 20:44
    Aaronontheweb labeled #4002
  • 20:43
    Aaronontheweb milestoned #4002
  • 20:43
    Aaronontheweb opened #4002
  • 20:37
    Aaronontheweb synchronize #71
  • 20:20
    Aaronontheweb synchronize #71
jcwrequests
@jcwrequests
It's a common problem with frameworks. I believe early editions of MVC had the same issue.
Aaron Stannard
@Aaronontheweb
I think we added IDisposable support for actors since
which @Horusiath mentions in his answer
not ideal because it's explicit
but still, something
really all three of @Horusiath's strategies are good ones
I thought about using the actor construction pipeline for tackling that, so I'm glad he brought it up
jcwrequests
@jcwrequests
It's probably a problem as well on the JVM side and since Akka.net is based on it that baggage came along with it.
Aaron Stannard
@Aaronontheweb
yeah
I have no idea how they do DI
jcwrequests
@jcwrequests
The same way. I based my code on the implementation.
Aaron Stannard
@Aaronontheweb
nice
well in that case, it's a buyer-beware thing for akka.net
just like akka
and frankly I think that's an ok place to start
as nice as it would be to have automatic scoping for releasing injected resources
might not be feasible atm
jcwrequests
@jcwrequests
What would be nice if we could pass a lambda to the actor system that could be used by the supervisor to release references. Basically that is all that is really needed.
Aaron Stannard
@Aaronontheweb
hmmmm
you know
THAT might be doable
depends on what the lambda has to do
if you could put together a little proposal for doing that, @HCanber / @Horusiath / @rogeralsing might have some ideas on how that can be done
jcwrequests
@jcwrequests
It's just has to take the actor reference and call something like release(Actor).
Aaron Stannard
@Aaronontheweb
maybe it can get imbedded into Props by the IndirectActorProducer
and the ActorCell can call it on the actor itself during the restart / shutdown
since the ActorCell sits outside of the ActorRef
and the actor instance
so it can still be a self-contained concern
done as part of the Terminate step
jcwrequests
@jcwrequests
Makes sense to me.
If you get that to work you can make the JVM guys jealous. :smile:
Aaron Stannard
@Aaronontheweb
I think that would be neat. You should propose it - I think it'd be a popular idea.
jcwrequests
@jcwrequests
If you can point in me in the right direction in the code base I will o just that. It was something I wanted to do the first time but I was not familiar enough with all the inner workings.
Maybe I could use NDepend to help me out with that. It's been something on my back burner for a while and the guy who owns company gave me a free copy and I been meaning to do a blog post on it to repay him for his generosity. I have to sign off but I will start taking a look again and see what can be done. Cheers
Håkan Canberger
@HCanber
@Horusiath Sorry, missed your question. Yes I got started on the CircuitBreaker, as I needed one at work. More important things got in between though, so I haven't finished it. :( I've based mine on Akka's and supports a bit more than yours does (callbacks for example), and I've created a base class so one can add more states (for example the CB is in a BeingInitialized before it's closed for the first time)
Looking at your code, it seems to me that you have a few race conditions. Is your CB intended to be used from inside one actor instance only?
Bartosz Sypytkowski
@Horusiath
I've already presented my opinion in #706. I think we could build a pipeline plugin for DI frameworks and release disposable resources in it's BeforeIncarnated (it's called just before actor itself is disposed and destroyed/respawned).
@HCanber it's not an Akka specific, I need it for more general purpose works with projects not using Akka. Where do you see possible race conditions?
Håkan Canberger
@HCanber
``` C#
Bartosz Sypytkowski
@Horusiath
I thought you wouldn't try to release CB more than once ;)
Håkan Canberger
@HCanber
And the switch statement looks like there could be something hidden in there, but I'm not sure if it actually could cause any errors. One thread think the CB is closed, and then before it's executed it becomes open by another thread.
Bartosz Sypytkowski
@Horusiath
in my use case you initialize CB one for each action, that need it, then you can call if async from multiple threads and release it when all work is done
any proposed solution? without lock or double check it will be hard to achieve
acutally I don't think that executing closed behavior once/twice while CB is switching to open state it's a bad thing, if something caused CB to open, probably there are already many concurrent requests which already are waiting for their timeout or will fail anyway
one/few more calls which will pass the state check while state itself is changing, shouldn't make a difference
Håkan Canberger
@HCanber
I was thinking the same thing.
Bartosz Sypytkowski
@Horusiath
@nvivo how would your async/await support proposition work with dispatchers not operating on TPL at all?
Bartosz Sypytkowski
@Horusiath
Persistence tests/debug are so fu**ing hard