These are chat archives for akkadotnet/akka.net

24th
Apr 2015
Liam McLennan
@liammclennan
Apr 24 2015 02:57
Is there any info about Akka.net EventBus apart from http://getakka.net/wiki/EventBus? I'd like to know how to partition events other than just by type.
Stefan Sedich
@stefansedich
Apr 24 2015 04:04
@liammclennan looks like JVM akka supports a richer event bus, http://doc.akka.io/docs/akka/snapshot/java/event-bus.html
I am not sure about how much has been planned for akka.net @Aaronontheweb or @rogeralsing might have more ideas.
things like the ScanningEventBus and LookupEventBus could be ported over.
Liam McLennan
@liammclennan
Apr 24 2015 04:05
oh hi @stefansedich
Stefan Sedich
@stefansedich
Apr 24 2015 04:05
oh hi @liammclennan :D
from what I can tell the EventStream is the only implementation of the EventBus
Liam McLennan
@liammclennan
Apr 24 2015 04:10
Figured. I was trying to put pub/sub between actors so the dependencies are not so fixed.
Roger Johansson
@rogeralsing
Apr 24 2015 05:02
@liammclennan yes the event bus docs are completely lacking atm, I'll try to create some examples for it this weekend, its a great feature that dont get much exposure atm in akka.net
But in short, there is a baseclass one can inherit and override methods to categorize messages
Stefan Sedich
@stefansedich
Apr 24 2015 05:45
not yet @rogeralsing will do so tonight.
@rogeralsing do you think implementing things like LookupEventBus and SubchannelEventBus are useful?
Aaron Stannard
@Aaronontheweb
Apr 24 2015 05:51
@rogeralsing listening to it now
Stefan Sedich
@stefansedich
Apr 24 2015 05:51
LOL
Aaron Stannard
@Aaronontheweb
Apr 24 2015 05:51
;)
Stefan Sedich
@stefansedich
Apr 24 2015 05:51
didn't you record it :D
Aaron Stannard
@Aaronontheweb
Apr 24 2015 05:51
I can't get enough of hearing myself talk
Stefan Sedich
@stefansedich
Apr 24 2015 05:51
haha
you and me both
Stefan Sedich
@stefansedich
Apr 24 2015 05:59
I often listen to your voice at night right before going to sleep

notcreepy

Aaron Stannard
@Aaronontheweb
Apr 24 2015 05:59
LOL
Aaron Stannard
@Aaronontheweb
Apr 24 2015 06:22
just finished
I give myself a 10/10 A+ good job
errr :partly_sunny:
just kidding - I thought it turned out pretty well.I
I
I'm just jealous that Scott came up with all of the good analogies first :p
Arjen Smits
@Danthar
Apr 24 2015 06:34
@rogeralsing Btw async await is broken in nuget 1.0 package
Aaron Stannard
@Aaronontheweb
Apr 24 2015 06:34
yeah we've put a lot of fixes in for that since 1.0
Arjen Smits
@Danthar
Apr 24 2015 06:34
I feel like your a broken record ^^
Aaron Stannard
@Aaronontheweb
Apr 24 2015 06:34
#886 is the last big one
lol
Arjen Smits
@Danthar
Apr 24 2015 06:35
@Aaronontheweb Yup i know, Found one myself.
Aaron Stannard
@Aaronontheweb
Apr 24 2015 06:35
maybe it's by design so people start using PipeTo
;)
Arjen Smits
@Danthar
Apr 24 2015 06:37
lol
Ow I ran into something else thats not so obvious at first
(let me create a quick gist to illustrate)
 Receive<WorkComplete>(_ => {
      //this never gets called, unless..
   });
never gets called. because the worker.tell(new StartWorkFor()) does not have a Sender reference
this is because the local actor context was not captured/ closed over
so you need to fix that by doing this:
 worker.Tell(new StartWorkFor(), Self); 
Aaron Stannard
@Aaronontheweb
Apr 24 2015 06:45
that makes sense
Arjen Smits
@Danthar
Apr 24 2015 06:45
its obvious for me, Because I know how Akka works. But its not so obvious from a newbie perspective
so maybe this should be something for the docs
Aaron Stannard
@Aaronontheweb
Apr 24 2015 06:46
yeah, this is a bit of an abstract concept and one of the reasons why I want to burn async / await with fire
Arjen Smits
@Danthar
Apr 24 2015 06:46
hahaha
Aaron Stannard
@Aaronontheweb
Apr 24 2015 06:46
closures are a fact of life for asynchronous programming and this is an instance when it's unavoidable
have to close over the part the context you need to set up the next call inside a continuation
PipeTo and TPL methods make it explicit
async and await just silently fails
_<
Arjen Smits
@Danthar
Apr 24 2015 06:47
But in this case. the subscription isn't async. Its just a closure/anonymous method func.
Aaron Stannard
@Aaronontheweb
Apr 24 2015 06:48
guess that emojii doesn't work
yeah, you're right
Arjen Smits
@Danthar
Apr 24 2015 06:48
i could do rabbitbus.SubscribeAsync
Aaron Stannard
@Aaronontheweb
Apr 24 2015 06:48
that's something we're just going to have to educate people on - I make a point of doing that in Akka.NET bootcamp
Arjen Smits
@Danthar
Apr 24 2015 06:48
then it would interpret the func im passing, as a Task
:nods:
I have hold off on doing async await stuff in the example I just displayed. Due to the current bugs with Akka
All kinds of wierd stuff happens once I do that lol
Aaron Stannard
@Aaronontheweb
Apr 24 2015 06:50
PipeTo is your friend
just sayin
Arjen Smits
@Danthar
Apr 24 2015 06:50
PipeTo marshalls it back to the original actor context?
Aaron Stannard
@Aaronontheweb
Apr 24 2015 06:51
nope - turns the result of a task into a new message
it's just an extension method
Arjen Smits
@Danthar
Apr 24 2015 06:51
owyeah. I know that
just realized. isn't it 02:00 over at your place now?
Aaron Stannard
@Aaronontheweb
Apr 24 2015 06:53
midnight - west coast of the US
Arjen Smits
@Danthar
Apr 24 2015 06:53
ah, so late. but not that late :P
Anthony Brown
@bruinbrown
Apr 24 2015 13:25
@Aaronontheweb just given the hanselminutes a listen, really good, given me some nice analogies to help explain it better
Natan Vivo
@nvivo
Apr 24 2015 14:19
Suppose I want to customize the default dispatcher, can I do this?
akka.actor.default-dispatcher {
    throughput = 50
    throughput-deadline-time = 1s
}
Roger Johansson
@rogeralsing
Apr 24 2015 14:20
Yes
Natan Vivo
@nvivo
Apr 24 2015 14:20
thanks
Roger Johansson
@rogeralsing
Apr 24 2015 14:22
Whichever occurs first , count or deadline will exit the mailbox run
Arjen Smits
@Danthar
Apr 24 2015 14:43
Hmm
Can I pass an ActorSelection instance around in messages ?
myActor.Tell(new MyMessage() { childWorker = Context.ActorSelection("myactor") });
So like that?
reason I am asking is because Im using a specific actor to process certain database actions. And I want to...
ok nevermind
Natan Vivo
@nvivo
Apr 24 2015 14:47
I think you can, since you can pass ActorRefs
Arjen Smits
@Danthar
Apr 24 2015 14:47
realised using a concistent hashing router would solve my problems
but yeah I think its possible as well. Because when I think about it. An ActorSelection behind the scenes is nothing more then an url to your Actor
But my question was wrong. I expected it to work when working with the Local ActorSystem (so in memory). But I was wondering if that would work when doing any remote stuff.
And from a conceptual level. It should work.
Natan Vivo
@nvivo
Apr 24 2015 14:53
My guess is that it will, but there might be better ways. Seems to me that if I want to pass an actor selection, I could pass just the path to the actor instead as string and create the object there.
I'm just thinking out loud here... don't mind if I say something wrong. =)
Arjen Smits
@Danthar
Apr 24 2015 14:59
Oh no problem at all. And yes your right. Passing along the path to the ActorRef as a string would work as well.
Anthony Brown
@bruinbrown
Apr 24 2015 15:10
I seem to remember reading somewhere that you do need to be careful when sharing actorselections if you're taking them from a context, e.g. a path of ../sibling will only be resolved at the stage the message is delivered, there's also a note in the JVM akka docs that ActorRefs are preferred http://doc.akka.io/docs/akka/snapshot/java/untyped-actors.html#Identifying_Actors_via_Actor_Selection
I may be wrong on that though
Natan Vivo
@nvivo
Apr 24 2015 15:36
If I create multiple dispatchers, all using the ThreadPoolDispatcher, they should each use a different throughput but all would use the default thread pool right?
Arjen Smits
@Danthar
Apr 24 2015 15:52
@bruinbrown your right. But there they are talking about relative paths. Which makes sense.
Aaron Stannard
@Aaronontheweb
Apr 24 2015 16:01
@bruinbrown thanks Anthony! glad you like it
Natan Vivo
@nvivo
Apr 24 2015 16:04
@Aaronontheweb i have a conceptual question for you...
Aaron Stannard
@Aaronontheweb
Apr 24 2015 16:04
what's up?
Natan Vivo
@nvivo
Apr 24 2015 16:05
I want to explain the difference between "dispatchers" that you create in HOCON, and dispatchers as components , like the ThreadPoolDispatcher
would it be right to call what you set in hocon as "dispatcher configurations"?
or do you think those are dispatchers, and the components are just "dispatcher types" ?
Aaron Stannard
@Aaronontheweb
Apr 24 2015 16:05
so the difference between dispatcher implementations and instances?
Natan Vivo
@nvivo
Apr 24 2015 16:06
yep. because this is something that is a little bit confusing in the docs currenty.
Aaron Stannard
@Aaronontheweb
Apr 24 2015 16:06
in HOCON you define a dispatcher configuration - this includes some commonly shared properties like Throughput
but it also allows you to specify the dispatcher type
Natan Vivo
@nvivo
Apr 24 2015 16:06
So
I think what I wrote is correct
Aaron Stannard
@Aaronontheweb
Apr 24 2015 16:07
so ForkJoinDispatcher, PinnedDispatcher, are types
Natan Vivo
@nvivo
Apr 24 2015 16:07
I'm using the term "dispatcher configuration" to describe the hocon sections
and Dispatchers are actually the types
I should create the PR soon, so you can take a look and see what you think
Aaron Stannard
@Aaronontheweb
Apr 24 2015 16:08
yep, that sounds right
one thing worth noting
some dispatcher types always return a new instance of the dispatcher configuration
the pinned dispatcher and current synchronization context dispatcher, for instance
whereas others, like the ForkJoinDispatcher and the ThreadPoolDispatcher, always return the same shared instance
Natan Vivo
@nvivo
Apr 24 2015 16:09
wait
Aaron Stannard
@Aaronontheweb
Apr 24 2015 16:09
that's an implementation detail of the MessageDispatcherConfigurator
Natan Vivo
@nvivo
Apr 24 2015 16:10
do you mean if I create 2 dispatchers using ThreadPool, each with a different Throughput, only the last one will be used?
Aaron Stannard
@Aaronontheweb
Apr 24 2015 16:10
no
it means that the same instance of the underlying dispatcher
Natan Vivo
@nvivo
Apr 24 2015 16:10
oh, right!
that's what I got from the code
Aaron Stannard
@Aaronontheweb
Apr 24 2015 16:10
yeah
Natan Vivo
@nvivo
Apr 24 2015 16:10
ThreadPool is only one, configurations are many
Aaron Stannard
@Aaronontheweb
Apr 24 2015 16:10
yep
Natan Vivo
@nvivo
Apr 24 2015 16:11
ok. thanks
Aaron Stannard
@Aaronontheweb
Apr 24 2015 16:11
the ForkJoinDispatcher gets its own thread pool per-configuration
because that's a configurable detail
Natan Vivo
@nvivo
Apr 24 2015 16:11
right
Anthony Brown
@bruinbrown
Apr 24 2015 16:13
@Aaronontheweb got a ToC review back this week, featured this line at the end "As a side note, if the author is on the Petabridge team, they would have 100% of my vote of confidence"
Natan Vivo
@nvivo
Apr 24 2015 16:36
In order to use the SynchronizedDispatcher, do I need to call "system.ActorOf" from the UI thread?
Aaron Stannard
@Aaronontheweb
Apr 24 2015 16:37
that-is-awesome.gif
that was for you @bruinbrown
@nvivo yep - need to call ActorOf in the synchronization context you want to run on
Natan Vivo
@nvivo
Apr 24 2015 16:38
ok
Bartosz Sypytkowski
@Horusiath
Apr 24 2015 16:45
heh, in last 24 hour one of the PRs completely broken my Akka.Persistence.SqlServer plugin :/
Aaron Stannard
@Aaronontheweb
Apr 24 2015 16:45
:(
I know that feeling
Natan Vivo
@nvivo
Apr 24 2015 16:45
Impossible.
Aaron Stannard
@Aaronontheweb
Apr 24 2015 16:45
was it one of those "get rid of unused usings" PRs?
Natan Vivo
@nvivo
Apr 24 2015 16:46
Code is always perfect, bugs don't exist
Bartosz Sypytkowski
@Horusiath
Apr 24 2015 16:46
Cause: [akka://SqlServerJournalSpec/system/journal]: Akka.Actor.ActorInitializationException: Exception during creation ---> System.Exception: Error while creating actor instance of type Akka.Actor.ActorBase with 0 args: () ---> System.InvalidOperationException: No actor producer specified!
Joshua Benjamin
@annymsMthd
Apr 24 2015 16:46
That's why I'm getting this testing thing on lock
Bartosz Sypytkowski
@Horusiath
Apr 24 2015 16:46
;)
Aaron Stannard
@Aaronontheweb
Apr 24 2015 16:47
@nvivo so one time when I was working at Microsoft we had a massive, massive azure outage caused by a leap year issue with our management certs
it was hilariously stupid
this is before Guthrie took over Azure
2011
Azure management at the time consistent of a bunch of old school Windows Server people
arrogant bastards the entire lot of them
Joshua Benjamin
@annymsMthd
Apr 24 2015 16:48
eww
Bartosz Sypytkowski
@Horusiath
Apr 24 2015 16:48
yesterday we were publishing on Azure with no backup or recovery strategy xD
Aaron Stannard
@Aaronontheweb
Apr 24 2015 16:48
so while our customers were yelling at us we came up with a list of "what excuses will Azure PR make up for this outage"
along the lines of "our product is perfect you're using it wrong and fuck you"
Natan Vivo
@nvivo
Apr 24 2015 16:48
haha
classic management
Aaron Stannard
@Aaronontheweb
Apr 24 2015 16:49
winner was "Azure didn't crash - Microsoft simply found a bug in the Earth's rotation"
Natan Vivo
@nvivo
Apr 24 2015 16:49
hahahahahaha
Aaron Stannard
@Aaronontheweb
Apr 24 2015 16:49
my suggestion, the runner up
was the the SLA technically only covered 365 days a year
(turns out that one was true)
Natan Vivo
@nvivo
Apr 24 2015 16:50
haha lucky you it wasn't written on a leap year. You'd have to strech time to make it valid otherwise
Aaron Stannard
@Aaronontheweb
Apr 24 2015 17:04
actually I guess this happened Feb 2012
right after the Gu started
all of that's a blur
Roger Johansson
@rogeralsing
Apr 24 2015 17:09
anyone got a link to the CQRS example someone built? @Horusiath you built some example also?
Bartosz Sypytkowski
@Horusiath
Apr 24 2015 17:10
yes, but I didn't finished yet
Natan Vivo
@nvivo
Apr 24 2015 18:37
@Danthar your changes to DI docs look good to me.
Bartosz Sypytkowski
@Horusiath
Apr 24 2015 19:00
@rogeralsing @Aaronontheweb I think #842 is ready
Bartosz Sypytkowski
@Horusiath
Apr 24 2015 19:34
we need to clean up backlog a little
@Aaronontheweb what is the state of #259 ? Maybe I could help you there?
James Conway
@jwconway
Apr 24 2015 20:19
I'm wondering if anyone could give me any guidelines on implementing a UDP transport for akka.
I tried to mimic the TCP transport mechanism to no avail
Bartosz Sypytkowski
@Horusiath
Apr 24 2015 20:19
@Aaronontheweb is the person to go
Arjen Smits
@Danthar
Apr 24 2015 20:31
@nvivo thx. but as I mentioned, im not happy yet :P cant put my finger on it though. So im going to sleep on it and then take another look at it.
Natan Vivo
@nvivo
Apr 24 2015 21:37
What about akka over quic?
Bartosz Sypytkowski
@Horusiath
Apr 24 2015 21:38
quic from Google? It's very fresh and nobody knows if it will be adopted by anyone outside
Natan Vivo
@nvivo
Apr 24 2015 21:39
Yep, just wondering. Was taking a look at the protocol
Still, google already has a good portion of internet traffic over that. It's interesting how they can come up with an alternative to things loke tcp and udp and get such a high usage with nobody knowing
*like
Was looking at my chrome internals, any google traffic is moving through spdy over quic. Amazing