These are chat archives for akkadotnet/akka.net

8th
Jun 2017
Gregorius Soedharmo
@Arkatufus
Jun 08 2017 03:01 UTC
@Silv3rcircl3 Seems like FileIO.cs is due for an overhaul? the scala version already deprecared toFile and fromFile
Gregorius Soedharmo
@Arkatufus
Jun 08 2017 06:07 UTC
whats ExecutionContexts in akka scala? Is is a Task (Future) runner?
Zetanova
@Zetanova
Jun 08 2017 07:55 UTC
I think i got a bug in the scheduler
i am using
Context.System.Scheduler.ScheduleTellOnce(TimeSpan.FromSeconds(15), Self, currentMessage, ActorRefs.Nobody);
and the message is not arriving a second time
after 90sec
Arjen Smits
@Danthar
Jun 08 2017 08:14 UTC
Well. it IS ScheduleTellOnce
Its only going to do it Once
nothing new but it's nice to see
Arjen Smits
@Danthar
Jun 08 2017 08:51 UTC
thats for sure :)
Maciek Misztal
@mmisztal1980
Jun 08 2017 09:06 UTC
btw, with 1.3 is there going to be a new way to read hocon config? or is it the goold old xml config file?
Maciek Misztal
@mmisztal1980
Jun 08 2017 10:27 UTC
(I'm asking b/c I'd like to do some nix-based development :) )
Gregorius Soedharmo
@Arkatufus
Jun 08 2017 10:28 UTC
@Silv3rcircl3 port done :+1:
Zetanova
@Zetanova
Jun 08 2017 11:10 UTC
@Danthar the Message is arriving and it gets delayed with the help of the scheduler.
Zetanova
@Zetanova
Jun 08 2017 11:20 UTC
think it is a problem with my code (of course)
Arjen Smits
@Danthar
Jun 08 2017 11:53 UTC
@Zetanova if you can share a gist of how your actor looks, via PM or otherwise. I can take a look.
Lealand Vettleson
@spankr
Jun 08 2017 13:13 UTC
@BertLamb Sweet! I'll check it out!
Lealand Vettleson
@spankr
Jun 08 2017 13:18 UTC
@BertLamb I like it! You even added delete logic.
Bert Lamb
@BertLamb
Jun 08 2017 13:44 UTC
@spankr trying to work out the snapshot stuff led me to looking at the scala akka implementation from EventStore https://github.com/EventStore/EventStore.Akka.Persistence and so I may end up just trying to port that
but I'm still very much a scala n00b so working out exactly how that one works may hurt my brain a little
Gregorius Soedharmo
@Arkatufus
Jun 08 2017 13:45 UTC
welcome to the club
Lealand Vettleson
@spankr
Jun 08 2017 13:48 UTC
lol. I look forward to seeing how it turns out. I've been reading the EventStore docs and been pondering having a separate ES persistence plugin that is backed by their REST. That hasn't gone any further than "pondering" though.
Gregorius Soedharmo
@Arkatufus
Jun 08 2017 13:49 UTC
the post scala trauma disorder club
Lealand Vettleson
@spankr
Jun 08 2017 13:49 UTC
scala is still on my TODO list :|
Bert Lamb
@BertLamb
Jun 08 2017 14:01 UTC
I learned enough so that I could read Mastering Akka
and now here I am with 3 copies of visual studio open and one IntelliJ
Zetanova
@Zetanova
Jun 08 2017 15:24 UTC
I am currenlty using Guid as my correlationId
would it be better to warp the Guid inside a serializable Correlation class type
so that the reference equality can be checked instead of the Guid
and will it help to pass the correlationId around as reference instead of as valuetype ?
Gregorius Soedharmo
@Arkatufus
Jun 08 2017 15:34 UTC
depends whether you instantiate your actors across network or not?
if you do instantiate one across the network, I imagine a reference wont work
or across processes
Zetanova
@Zetanova
Jun 08 2017 15:37 UTC
return Object.IsReferenceEquals(a, b) || a.id == b.id;
Gregorius Soedharmo
@Arkatufus
Jun 08 2017 15:39 UTC
well, if you pass the correlation id as reference in the first place, won't a.id be different than b.id?
Zetanova
@Zetanova
Jun 08 2017 15:40 UTC
if i would create a type of class CorrelationId
guid is a valuetype and has 16bytes
a reference is 8bytes
hard to tell whats faster
Gregorius Soedharmo
@Arkatufus
Jun 08 2017 15:42 UTC
well, it would matter if you use low bandwith high latency network/connection
but if you're running on a single machine, I'd say the memory bus speed is more of a bottleneck than 8 bytes of data?
I'm just making a wild guess here, you should make your own benchmark, of course...
Zetanova
@Zetanova
Jun 08 2017 15:47 UTC
its not the data size, its the message construction and replies of them
and Dictionary<Guid, Something>
not sure, but i think that IL is copying the valuetype on paramters
new MyMessage(correlationId)
will do the perf test in "time"
i hope only that it will not be to late
Gregorius Soedharmo
@Arkatufus
Jun 08 2017 15:53 UTC
well, comparison wise, by reference would always beat by value hands down
Zetanova
@Zetanova
Jun 08 2017 15:55 UTC
think so too and in serialization?
Gregorius Soedharmo
@Arkatufus
Jun 08 2017 15:56 UTC
by calculating the IL code naively, by ref would require 3-5 IL codes while by val would take at least 33 IL codes
Zetanova
@Zetanova
Jun 08 2017 15:56 UTC
good to know
Gregorius Soedharmo
@Arkatufus
Jun 08 2017 15:59 UTC
by serialization, i'm not sure... depends if the guid is being serialized to string or to byte array... can you actually serialize a by ref value? like, really sending the pointer address?
in a managed executable?
where the memory location can be shuffled at any time by the GC?
I'd imagine there will be unsafe code blocks and unsafe cast and a potential headache later on
Zetanova
@Zetanova
Jun 08 2017 16:02 UTC
that is not the plan
the plan is to warp the correlationId (Guid value) inside a ref type
and work with it
if it is getting serialized the other side will check on value equality if the reference equality fails
Gregorius Soedharmo
@Arkatufus
Jun 08 2017 16:08 UTC
that might work, you can always try, I guess. byte array serialization should be faster than string, you can read the coreclr source for guid here: https://github.com/dotnet/coreclr/blob/master/src/mscorlib/src/System/Guid.cs
Zetanova
@Zetanova
Jun 08 2017 16:12 UTC
i will make the warper
with implicit cast to and from Guid
Is it somehow possible to cast this type allways to Guid in serialization?
Gregorius Soedharmo
@Arkatufus
Jun 08 2017 16:16 UTC
guid itself doesn't have any implicit casting, the only limit is your own guarantee that your implicit cast logic is always serializable
Zetanova
@Zetanova
Jun 08 2017 16:21 UTC
the serializer will allways serialize the warp type and not to Guid or even byte[]
thinking more about PersistenceStore
Gregorius Soedharmo
@Arkatufus
Jun 08 2017 16:32 UTC
just make sure you don't over engineer your code