These are chat archives for akkadotnet/akka.net

19th
Dec 2016
Arjen Smits
@Danthar
Dec 19 2016 09:52
Nice post and explanation @Horusiath http://bartoszsypytkowski.com/optimizing-event-journals/
Bartosz Sypytkowski
@Horusiath
Dec 19 2016 12:16
thx ;)
Arjen Smits
@Danthar
Dec 19 2016 13:41
when we release the new implementation, we should put a link to that post in the release notes. It would help in letting people know what changed, why, and how it might impact them
Bartosz Sypytkowski
@Horusiath
Dec 19 2016 13:56
When I wrote it, I've seen that it's more something that should be placed in a docs than inside blog post ;)
Arjen Smits
@Danthar
Dec 19 2016 14:35
true :)
wauw
like... feels like the nail in the coffin for java
to11mtm
@to11mtm
Dec 19 2016 18:48
@Horusiath Hey I was poking at some code thinking about akkadotnet/Hyperion#8 and noticed something that may be useful depending on how elegant MVP versus final solution needs to be...
But it looks like you can set readonly values on a struct if it was created by GetUninitializedObject: Sample here http://share.linqpad.net/499axc.linq
Bartosz Sypytkowski
@Horusiath
Dec 19 2016 19:51
@to11mtm thx, but for some reason this doesn't work :)
once I'll find out why it doesn't work, maybe I'll find out how to make it work :)
Bartosz Sypytkowski
@Horusiath
Dec 19 2016 20:07
the funny part is that we actually fill readonly fields in a the same way, you're using in you're using. But it throws
to11mtm
@to11mtm
Dec 19 2016 20:28
HAHAHA wtf
Bartosz Sypytkowski
@Horusiath
Dec 19 2016 20:32
I've fixed that, I understand what I changed, but I don't understand how was that supposed to change anything
Bartosz Sypytkowski
@Horusiath
Dec 19 2016 20:53
basically, the code-gen first we were creating instance using Activator. That was returning a null, so the next we generated cast to a deserialized type. However later, for readonly fields, we were setting them with FieldInfo.SetValue(object, object), but that requires an object as a first param. So we generated code responsible for casting it back to object (but only for readonly fields). So struct created using activator → casted to its type → casted back to object, was causing an error.
what I've changed, was passing a direct reference to an object returned from activator (so we omitted all casts in this case). That worked.
to11mtm
@to11mtm
Dec 19 2016 21:02
Interesting...