Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 13:10
    zbynek001 opened #4000
  • 11:20
    IgorFedchenko commented #3973
  • 11:20
    IgorFedchenko commented #3973
  • 11:18
    IgorFedchenko commented #3973
  • 10:47
    IgorFedchenko synchronize #3973
  • 10:13
    valdisz commented #3921
  • Oct 21 15:57
    Aaronontheweb closed #3877
  • Oct 21 15:57
    Aaronontheweb commented #3877
  • Oct 21 15:56

    Aaronontheweb on dev

    Persistence TestKit documentati… (compare)

  • Oct 21 15:56
    Aaronontheweb closed #3889
  • Oct 21 07:27
    dependabot-preview[bot] labeled #3999
  • Oct 21 07:27

    dependabot-preview[bot] on nuget

    Bump FluentAssertions from 4.14… (compare)

  • Oct 21 07:27
    dependabot-preview[bot] opened #3999
  • Oct 20 17:25
    valdisz synchronize #3889
  • Oct 20 17:17
    valdisz synchronize #3889
  • Oct 20 15:44
    valdisz synchronize #3889
  • Oct 20 09:22
    ismaelhamed commented #3863
  • Oct 19 23:39
    valdisz synchronize #3889
  • Oct 19 23:08
    edvinasz commented #2947
  • Oct 19 13:36
    Aaronontheweb commented #3973
Aaron Stannard
@Aaronontheweb
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
Stefan Sedich
@stefansedich
hey guys just looking at the IoC chat
"It's just has to take the actor reference and call something like release(Actor)."
in autofac for example you would not do it that way but instead reslove a lifetime scope or an owned instance and then dispose of that after, there is no release method on the actual container.
Stefan Sedich
@stefansedich
For those interested updated with my findings of the issues with Mono and the fixes required, akkadotnet/akka.net#636 we are now happily running in Mono using these fixes.
jcwrequests
@jcwrequests
@stefansedich The release thing is based on the following post http://blog.ploeh.dk/2014/05/19/di-friendly-framework/ which I think does an excellent job explaining the need plus its an interesting read.
Stefan Sedich
@stefansedich
You look at autofac for example
they don't have release in that way instead the request gets wrapped in a lifetime scope which itself is disposed.
Although if using autofac we could resolve an Owned<T> and in the release dispose that
would probably be enough
where T being the actor type
so yeah sorry release is probably enough :)
Raymen Scholten
@raymens
Is there someway to append a incrementing number to an actors name that will enforce the name to be unique? (like SomeRandomActor-Child-1, ....-Child-2, ....)
Raymen Scholten
@raymens
And is it correct that the F# API doesn't provide any F# specific stuff about creating an actor that has a constructor or any means of saving state?
Raymen Scholten
@raymens
There are probably better ways but
let actorOfCtor (state : 'a) (fn : 'a -> 'Message -> unit) (mailbox : Actor<'Message>) : Cont<'Message, 'Returned> =
let rec loop() =  
    actor {  
        let! msg = mailbox.Receive() 
        fn state msg 
        return! loop() 
    } 
loop()
allows the creation of an actor that will have some sort of initial data that is usable by the messageHandler every message
Bartosz Sypytkowski
@Horusiath
@raymens if you must use some state in F# API, pass it as a rec loop parameter , eg:
type MyState = { X: int; Y: int }
let aref = spawn system "my-actor" <| fun mailbox ->
    let rec loop state = actor {
         let! msg = mailbox.Receive()
         return! loop ({ state with Y = msg })
    }
    loop ({X = 1; Y = 2})