Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 01:47
    Arkatufus opened #4240
  • 00:10
    Aaronontheweb synchronize #4212
  • Feb 20 23:50
    Aaronontheweb synchronize #4238
  • Feb 20 23:48
    Aaronontheweb commented #4234
  • Feb 20 23:47
    Aaronontheweb synchronize #4212
  • Feb 20 23:46

    Aaronontheweb on dev

    close #4234 - added CachingConf… (compare)

  • Feb 20 23:46
    Aaronontheweb closed #4239
  • Feb 20 23:46
    Aaronontheweb closed #4234
  • Feb 20 23:25
    Aaronontheweb synchronize #4239
  • Feb 20 23:24
    Aaronontheweb opened #4239
  • Feb 20 23:14
    Aaronontheweb commented #4234
  • Feb 20 22:52
    Aaronontheweb commented #4234
  • Feb 20 22:27
    Aaronontheweb synchronize #4212
  • Feb 20 22:27
    Aaronontheweb commented #4238
  • Feb 20 22:24
    Aaronontheweb synchronize #4212
  • Feb 20 21:48
    cptjazz synchronize #4238
  • Feb 20 21:07
    Aaronontheweb labeled #4238
  • Feb 20 20:58
    cptjazz opened #4238
  • Feb 20 20:45
    Aaronontheweb ready_for_review #4212
  • Feb 20 20:45
    Aaronontheweb edited #4212
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?
Roger Johansson
@rogeralsing
Id say gitter, most of us are here every day
Aaron Stannard
@Aaronontheweb
@Horusiath very little, although I'm in the process of migrating it to its own organization and publishing docs around Helios 2.0
the only real docs I have for at it at the moment are its specs and samples
@stefansedich submitted a PR a couple of days ago which should enable Mono support in Helios
and should fix the Akka Remoting issues
turns out that TcpClient and UdpClient call Socket.Bind in their constructors on Mono, which makes it impossible to set socket options on them
Aaron Stannard
@Aaronontheweb
@smalldave you might appreciate this, btw https://github.com/petabridge/lighthouse - took an old project I started on with Akka.Cluster a while back and I'm modernizing it now