Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 16:12
    Aaronontheweb commented #3993
  • 15:51
    dependabot-preview[bot] synchronize #3991
  • 15:51

    dependabot-preview[bot] on nuget

    Bump Microsoft.Extensions.Depen… (compare)

  • 15:51
    dependabot-preview[bot] synchronize #3989
  • 15:51

    dependabot-preview[bot] on nuget

    Bump ApiApprover from 3.0.1 to … (compare)

  • 15:51
    dependabot-preview[bot] edited #3991
  • 15:51
    dependabot-preview[bot] edited #3989
  • 15:51
    dependabot-preview[bot] synchronize #3985
  • 15:51

    dependabot-preview[bot] on nuget

    Bump FsCheck.Xunit from 2.9.0 t… (compare)

  • 15:51
    dependabot-preview[bot] edited #3985
  • 15:51
    dependabot-preview[bot] synchronize #3982
  • 15:51

    dependabot-preview[bot] on nuget

    Bump FsPickler from 5.2.0 to 5.… (compare)

  • 15:51
    dependabot-preview[bot] synchronize #3986
  • 15:51
    dependabot-preview[bot] synchronize #3983
  • 15:51

    dependabot-preview[bot] on nuget

    Bump NUnit from 3.6.1 to 3.12.0… (compare)

  • 15:51
    dependabot-preview[bot] synchronize #3993
  • 15:51

    dependabot-preview[bot] on nuget

    Bump ApprovalUtilities from 3.0… (compare)

  • 15:51
    dependabot-preview[bot] synchronize #3992
  • 15:51

    dependabot-preview[bot] on nuget

    Bump Google.Protobuf from 3.9.1… (compare)

  • 15:51

    dependabot-preview[bot] on nuget

    Bump System.Reflection.Emit fro… (compare)

Aaron Stannard
@Aaronontheweb
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})
this way it maintain F# principles - immutable data, function as unit of composition etc.
Raymen Scholten
@raymens
thanks, that's better :)
Håkan Canberger
@HCanber
@raymens If you don't name an actor, the system will assign it a unique name. If you want the name to follow some kind of pattern, like in your example, you have to write it yourself.
Bartosz Sypytkowski
@Horusiath
@Aaronontheweb do you have some kind of the documentation or tech. overview to Helios? I'd like to see, what else purposes could it serve.
Raymen Scholten
@raymens
@HCanber allright, thank you
Raymen Scholten
@raymens
Are questions better suited for StackOverflow or gitter?