These are chat archives for akkadotnet/akka.net

28th
Jul 2016
Aaron Stannard
@Aaronontheweb
Jul 28 2016 08:41
@Silv3rcircl3 think that might have something to do with it? weird that it would work for some but not others
Marc Piechura
@marcpiechura
Jul 28 2016 08:49
Who knows ;) I had the ActorSelection issue in mind which is also not working with deployed paths. But I really don't know if that effects streams, nor why it would work half the time
Aaron Stannard
@Aaronontheweb
Jul 28 2016 08:49
wonder if it's a race condition that occurs during materialization
maybe with the actor sink
we create the sink in the constructor of the actor who is going to be the sink
Arsene T. Gandote
@Tochemey
Jul 28 2016 08:50
Hello how can I read a subset of bytes from ByteString using the ByteIterator?
Aaron Stannard
@Aaronontheweb
Jul 28 2016 08:50
the stream is sending messages to itself
Marc Piechura
@marcpiechura
Jul 28 2016 08:50
What exactly do you mean by "creating the sink"?
Aaron Stannard
@Aaronontheweb
Jul 28 2016 08:50
I put the source up a bit earlier
let me link it
that's what I mean
Marc Piechura
@marcpiechura
Jul 28 2016 08:52
ah ok, nop that shouldn't be the issue, that returns only the "blueprint" for the sink, the actual actors are only created when you materialize the stream by calling one of the Run methods
happens there during message processing
Marc Piechura
@marcpiechura
Jul 28 2016 08:54
ok so you create a new stream for every ProcessDocuments message
Aaron Stannard
@Aaronontheweb
Jul 28 2016 08:55
yeah I guess so huh
how would I re-use that given that the source input is all that changes
Marc Piechura
@marcpiechura
Jul 28 2016 08:56
you could materialize the stream into an IActorRef and then you can send it messages which are then injected into the stream
Aaron Stannard
@Aaronontheweb
Jul 28 2016 08:56
.... dude
that's awesome
how do I do that?
I couldn't find a lot on the "materialization" stuff in the docs
might have been buried in there but I tried going through all of it
Marc Piechura
@marcpiechura
Jul 28 2016 08:58
give me a second I need to check the actorref part by myself
Aaron Stannard
@Aaronontheweb
Jul 28 2016 08:59
it's 2am here, I gotta head to bed anyway - but I'll check again tomorrow
spent way too much time fragging people in Overwatch tonight
Marc Piechura
@marcpiechura
Jul 28 2016 09:01
Source.ActorRef<int>()
that's it
but you need to provide buffer configuration since this actorref can't be backpressured
Also take a look at the ActorPublisher part that could maybe also fit
MartinNiemandt
@MartinNiemandt
Jul 28 2016 09:08
guys can someone point me in the right direction, I want to know if there is a easy way to check where in the queue a message is ( round robin router ) without custom logic?
Arsene T. Gandote
@Tochemey
Jul 28 2016 09:58
Hello please does the ByteString has some of functionalities of IByteBuffer of DotNetty?
Arsene T. Gandote
@Tochemey
Jul 28 2016 10:57
Hello. Assuming using Akka.IO and you have received some ByteString. Upon decoding the message you realized that you need to request for more bytes how can one go about it?
Marc Piechura
@marcpiechura
Jul 28 2016 11:16
@Tochemey you don't need to request for more bytes, you simply get them when they are available with the next Receivedmessage
Arsene T. Gandote
@Tochemey
Jul 28 2016 11:19
@Silv3rcircl3 I hope you have used DotNetty or Netty before. If not in the ReplayingDecoder implementation you can request for more read using the RequestReplay function so that you can more bytes.
@Silv3rcircl3 In the scenario I am in is this: I have read the bytes via Tcp.Received however I need to wait for more during the decoding. How best do you think I can about this using the Akka.IO.
I was thinking of mechanism to store the previous bytes read and use a cumulator to aggregate the new one read to be able to properly decode the message.
Marc Piechura
@marcpiechura
Jul 28 2016 11:28
mh are you sure that you need more data ? The Seriliazer I wrote for Akka.Signal worked fine for me and afaik @chris-ray has pushed a lot of data trough it without any issues
Arsene T. Gandote
@Tochemey
Jul 28 2016 11:41
@Silv3rcircl3 Maybe I am not explaining myself well. For the little knowledge I have Tcp push data as they come. So I need to implement some mechanism to handle partial read since Akka.IO deals with the raw bytes.
Marc Piechura
@marcpiechura
Jul 28 2016 11:48
I see, I don't have much knowledge about how the internals of Akka.IO are working. Maybe the source can help https://github.com/akkadotnet/akka.net/blob/dev/src/core/Akka/IO/TcpConnection.cs
Arsene T. Gandote
@Tochemey
Jul 28 2016 12:05
Thank you
I am using Nlog. However it seems that the log files are not created. Any advice?
Arsene T. Gandote
@Tochemey
Jul 28 2016 13:06
It seems that the Akka.Logger.Nlog is not working as expected or I am doing the right thing. I followed the doc (http://getakka.net/docs/Logging) and I cannot get my logs written. Any advice?
wdspider
@wdspider
Jul 28 2016 14:04
I haven't worked with the Akka.Streams; however, the Akka.Logger.Nlog seems to be working just fine with the Akka.Cluster stuff. However, I did have to add the following InternalLogger commands so that NLog would error out rather than failing silently when the NLog.config failed to parse correctly:
        public static void Main(string[] args)
        {
            // Ensure NLog logs errors even if config file can't be parsed
            InternalLogger.LogLevel = LogLevel.Error;
            InternalLogger.LogToConsoleError = true;
            InternalLogger.LogToTrace = true;
            InternalLogger.LogFile = "nlog.errors";

            // Initialize topshelf service
            HostFactory.Run(x =>
            {
                x.SetServiceName("MyService");
                x.SetDisplayName("My Service");

                x.UseNLog();

                x.StartAutomaticallyDelayed();
                x.Service<CoreNodeService>();
            });
        }
Peter Rosconi
@prosconi
Jul 28 2016 17:43
With clustered pool routers, is there a way to remote deploy number of instances based off of number of CPUs on remote machine?
Chris G. Stevens
@cgstevens
Jul 28 2016 18:41
Singleton-Proxy Question...
I can send a successful message to my singletons from my website when I only configure the website for one or the other. Either Red or Blue in the following example.
Not sure the correct way to configure as the following doesn't work.
cluster {

  seed-nodes = ["akka.tcp://mycluster@127.0.0.1:4053"] 
  roles = [Website]

  singleton-proxy {
    singleton-name = "bluejobmanager"
    role = "BlueWorker"
    singleton-identification-interval = 5s
    buffer-size = 100
  }

  singleton-proxy {
    singleton-name = "redjobmanager"
    role = "RedWorker"
    singleton-identification-interval = 5s
    buffer-size = 100
  }

}
Arsene T. Gandote
@Tochemey
Jul 28 2016 20:59
Hello can someone show me the c# version of this scala functions chaining : def receive: Receive = handle orElse reject
Peter Rosconi
@prosconi
Jul 28 2016 21:30
Does akka.net support Mono?
Chris G. Stevens
@cgstevens
Jul 28 2016 21:37
I think I found a clue to my answer. Looking at the JVM doc for singleton actors if I need to use different settings then I need to use the .Props. I will try this tonight and think it should work. If you don't please don't hesitate to let me know :) http://doc.akka.io/docs/akka/snapshot/scala/cluster-singleton.html
James Farrer
@jamesfarrer
Jul 28 2016 21:37
can anyone offer some input into how to model actors with regards to a system
say for example, i've got a webshop with a warehouse with inventory and i want to perform operations against that inventory, most obvious being say 'reserve this item against this order'
would i have some kind of data store which holds a list of the inventory and have say an InventoryManagementActor
or would i have an actor for each SKU / Item, i.e. an InventoryItemActor
Chris G. Stevens
@cgstevens
Jul 28 2016 21:45
In my case I need to make sure that when I run my "operations" which is my job. I need to make sure that no other system would run that key data. I ended up creating a JobManager that is a singleton. It stores it's state, what is it doing basically. So I always have one but if fails it can come back up on another node based on the state in my DB. The Job only runs once one a single node but distributes the work to the other nodes.
Chris G. Stevens
@cgstevens
Jul 28 2016 21:55
@jamesfarrer not sure if that helps.
Chris G. Stevens
@cgstevens
Jul 28 2016 22:37
@jamesfarrer also have you looked at the webcrawler example. It has a tracker as well.
qwoz
@qwoz
Jul 28 2016 22:56
@jamesfarrer how busy will the inventory system be? There are a few approaches you can take depending on whether you need B2C webscale (tons of simultaneous users querying a vast inventory) or if it's a small B2B type thing. If the latter and your scale requirements are minimal, a single actor processing all inventory would do the job nicely. Other actors can query your InventoryActor which is the source of truth for what is in stock, reserved, etc. Otherwise, yeah you can go with an actor per SKU and have that actor manage its own state.
to11mtm
@to11mtm
Jul 28 2016 23:56
stupid persistence question... if I'm calling Persist<TEvent> and passing event containing an Object of at-time-not-quite-determined-type, will I be able to take whatever was persisted in said enclosed object and reconstruct the contents?
public class Event // i.e. Can I persist this
{
  public object HeldEvent {get; protected set;} //But still do AS on whatever holds this if I get it back from persistence
  //OtherStuff
}