Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Dec 06 05:05
    Build #968 passed
  • Nov 19 21:14
    Build #966 passed
  • Nov 19 06:43
    Build #965 passed
  • Nov 19 06:38
    Build #964 passed
  • Nov 18 06:26
    Build #963 passed
  • Nov 02 19:12
    Build #962 passed
  • Sep 18 05:12
    Build #961 passed
  • Sep 01 14:59
    Build #960 passed
  • Aug 23 11:48
    Build #959 passed
  • Aug 16 08:32
    Build #958 passed
  • Aug 13 18:35
    Build #957 passed
  • Aug 12 02:43
    Build #955 passed
  • Aug 10 01:56
    Build #954 passed
  • Jul 25 03:14
    Build #953 passed
  • Jul 24 15:23
    Build #952 passed
  • Jun 23 22:19
    Build #949 passed
  • May 02 19:15
    Build #948 passed
  • May 02 07:02
    Build #947 passed
  • May 02 06:58
    Build #946 passed
  • Apr 29 23:06
    Build #940 passed
Stefan Lauer
@Algorab
After update I see that Tell is moved from the actor to the context. What isn't clear for me what is the difference between Request and Send; And when I use Send() and when Request()?
anthonyhawes
@anthonyhawes
@Algorab Request includes the sender along with the message, but Send does not. This allows and actor to send a response back as part of processing a message
Stefan Lauer
@Algorab
@anthonyhawes Ok, thanks got it.
Andreas Vilinski
@vilinski
I understand that summer is a vacations time, but some issues and PRs are hanging around without answer. is there somebody who can look at? At least whether one should proceed or not
Иван Сердюк
@oceanfish81_twitter
Who is able to speak in Kiev, in October or November?
Noah Santschi-Cooney
@Strum355
@vilinski what PRs in particular
咚咔
@cupen
Hello guys. Is protoactor-go cluster ready for production environment? the document is here http://proto.actor/docs/grains
Stefan Lauer
@Algorab
I have a litte application with a couple of actors. I want to write some tests for it. In the documentation can’t find how to do it. So I look direkt in the proto.actor code, and get some hints. Is there some further examples / code where I can see how to check Message was Send / Received of an actor and look into the internal state?
Vindil
@Vindil
I have submitted a test kit in a pull request. Sounds like that would be helpful for you
Stefan Lauer
@Algorab
@Vindil I found your pull request in the protector-dotnet, is there something similar for protractor-go?
Vindil
@Vindil
Ah no it's only for dotnet unfortunately. Sorry
Noah Santschi-Cooney
@Strum355
@cupen we use a 2 node cluster in production and its working pretty good for us
咚咔
@cupen
@Strum355 OK , thank you for your response. I am using cluster in our test enviroment now. :smile:
ATRADER1000
@ATRADER1000
has anyone received a status message that an actor is "unavailable"? What can be done when an actor is "unavailable"?
Magnus Sydoff
@metscore
I consider myself a newbie when it comes to protoactor and I've only used it for about 10 months in a small server-client project. Nothing fancy, so I don't use multiple actors and all other fancy things etc. that I assume the framework was designed for. Due to this my question might be foolish beyond belief for some of the experts out there but I'll ask it anyway. :-)
My server is fairly dumb and just takes messages received in Task ReceiveAsync(IContext context) and forwards these to a driver that someone else wrote. This works very well and the client is happy since most calls are returned within a few milliseconds (up to a second) . However one of the calls from the client instructs the driver to measure something for more than 60 seconds and the driver is written in such a fashion that it does not return until the measurement is finalized. Obviously the client might like to cancel that ongoing process and here is where I run into problems.
I have a generic helper method public async Task<T> RequestAsync<T>(PID target, object message, TimeSpan timeout) performs something like
var context = new RootContext();
var response = await context.RequestAsync<T>(target, message, timeout);
which all of my calls are tunneled through.
However when the client tries (in another thread than originally called to start the measurement process) to cancel the ongoing process by calling the RequestAsync it gets stuck in the await context.RequestAsync call and this call never makes it to the server.
I've obviously done something wrong here , but if someone could shed some light or point me in a direction to get me out of the mess I'd be very grateful.
(I should probably mention that the targetPID is always the same. Maybe this is my problem ?)
King regards Magnus
anthonyhawes
@anthonyhawes
@ATRADER1000 I don't have experience with the cluster implementation, but the "unavailable" status means that an activator for a given kind cannot be located in the cluster. Have you registered all the kinds that are going to be requested?
anthonyhawes
@anthonyhawes
@metscore An actor will process messages one at a time. Unless you are running the driver as some kind of background task, the actor will wait until the driver has finished it's work before processing the next message
Magnus Sydoff
@metscore
@anthonyhawes Thank you for your answer! That seem reasonable. I will have to investigate on how to proceed. Secondary actor for cancelling messages or asking for the driver to be rewritten.... Well, we will have to see.
Ben Foster
@benfosterdev_twitter
Is there an example of implementing backpressure with the C# version of protoactor?
Magnus Sydoff
@metscore
Yet again one of those newbie questions :smile:
In my client/server setup I'm using protoactor and I wanted to have the server being notified if a client suddenly dies to be able to do some cleaning up. Thus I added (in my server's Task ReceiveAsync(IContext context)code) the following context.Watch(context.Sender) when I see a new client that I haven't seen before.
Things look very good, i.e. I immediately get a Terminated event when I abruptly kill my client. However I immediately discovered a problem in the client - all subsequent client calls to the server fails. A simple
var result = await ActorCommonHelpers.Instance.RequestAsync<ServerPropertiesResponse>(remotePID, new ServerPropertiesRequest(), new TimeSpan(0, 0, ServerPropertiesTimeout_s));
always return null but if I remove the context.Watch(context.Sender) the resultis received and the whole system runs beautifully as expected. (Someone would say it is a perfect call, but I wouldn't go that far :smirk: )
I'm obviously missing something obvious that needs to be done in order for the Watch to work, but can't seem to find any examples online of my wrongdoing.
Any advice is greatly appreciated.
King regards Magnus
Magnus Sydoff
@metscore
Ah.... I figured it out myself. I'm not sure it is the correct way of doing things, but I spawned a secondary actor with a register message that the server watches and then all the ordinary messages go through the primary actor just as they did before. I seem to work very well ! :smile:
Sebastian Stehle
@SebastianStehle
Hi, I would really dig into the world of actors. I am already using Orleans but would like to understand proto-actor / akka.net as well. Any project ideas (except chat server?). I need a mid size project to really understand the details. e.g. what I build to learn react: https://mydraft.cc/
Andreas Vilinski
@vilinski
if it's only learning, why not just port what you have to both other?
Sebastian Stehle
@SebastianStehle
Because it is not a typical actor setup I guess. I use it mainly for background jobs
Rakibul Hasan
@_rakibul__twitter
Hi is it possible to
Hi is there any gui to see all the actors and supervisor for protoactor? Something like observer in Erlang?
Valentin
@Valentin-Miroshnichenko
Rakibul Hasan
@_rakibul__twitter
@Valentin-Miroshnichenko Thank you!
Go Hagiwara
@oklahomer
Hi all,
I really like this project and would like to make some contribution toward official v1 release as discussed in AsynkronIT/protoactor-go#348 .
A month ago, I created a p-r that introduces some tests for remote actors: AsynkronIT/protoactor-go#358 . I intended to follow the other test implementation such as the use of mocks.
I believe in the importance of tests, but not sure if mine is implemented in an expected way. Could someone have a review or could we have a discussion how this should be done?
Rakibul Hasan
@_rakibul__twitter
In Proto.Actor go version, if one of the actor doing some long running operation what is the way of terminate the actor process?
Milosz Krajewski
@MiloszKrajewski
I am trying to marry dependency injection with known kinds, and it is a little bit puzzling. First I was thinking that I can register known kind when registering in ActorPropsRegistry, something like:
public static void RegisterPropsWithKind(
    this ActorPropsRegistry registry, Type type, string kind, Func<Props, Props> decorate)
{
    registry.RegisterProps(
        type, p => {
            var decorated = decorate(p);
            Remote.RegisterKnownKind(kind, decorated);
            return decorated;
        });
}

but unfortunately, the "decoration" function is not called immediately (to store Props in registry, it stores Func<Prop, Prop> in registry, so it calls it on creation request which is too late to register known kind).

The other idea I has was to actor factory to create props in kind registration:

public static void RegisterKind<T>(
    this IServiceProvider serviceProvider, string kind)
    where T: IActor
{
    var factory = serviceProvider.GetRequiredService<IActorFactory>();
    Remote.RegisterKnownKind(kind, Props.FromProducer(() => factory.GetActor<T>(...)));
}

but then I realised that actor factory produces PIDs not IActors.

Now, I guess it should be more like:

public static void RegisterKind<T>(
    this IServiceProvider serviceProvider, string kind, Func<Props, Props> decorate)
    where T: IActor
{
    var props = Props.FromProducer(() => serviceProvider.GetRequiredService<T>());
    Remote.RegisterKnownKind(kind, decorate(props));
}

but this means that serviceProvider has global scope while I guess it should be scoped for single actor creation.
Of course new scope can be create for serviceProvider but it needs to be disposed at some point so I would need to monitor lifetime of created actor?

Before I go this route, and spend few days... I am missing something? Is there any way to use register kind and dependency injection together easily?

zamap
@zamap_gitlab

Hi!, trying to go through example: created client server message projects. now have to add reference to proto file

import "Proto.Actor/Protos.proto";
message Connect
{
actor.PID Sender = 1;
}

installed via nuget Proto.Actor pkg but inside .proto can not resolve reference to actor.PID
and yes i dont want to clone all examples folders just want to use Proto.Actor to reuse Protos.proto
zamap
@zamap_gitlab
where is the magic?
Arkadiusz Wójcik
@arkadiuszwojcik
@MiloszKrajewski I managed to imeplement scoped DI in my project. The trick is to use ActorContextDecorator or inject receive Middleware and on Started/Stopped messages you create/destroy DI container.
Milosz Krajewski
@MiloszKrajewski
@arkadiuszwojcik Is it generic? Can you create a gist for it? I would be very grateful.
Adrien Candiotti
@SkinyMonkey
Hey :) Short question : with the go api, what's the canonic way to access the sender. I read in the issues that the Sender() method returns nil for performance reasons but in some cases i really need it.
I got a couple hacks up my sleeve but i was wondering what you guys could tell me about that
咚咔
@cupen
@SkinyMonkey pid.Request(msg, sender) see here https://github.com/AsynkronIT/protoactor-go/blob/dev/actor/pid.go#L100
Adrien Candiotti
@SkinyMonkey
Thank you @cupen
咚咔
@cupen
;)
咚咔
@cupen
@zamap_gitlab Just import the proto file which defines actor.PID.
see https://developers.google.com/protocol-buffers/docs/proto3#importing-definitions
see protoc --help
$ protoc --help
Usage: protoc [OPTION] PROTO_FILES
Parse PROTO_FILES and generate output based on the options given:
  -IPATH, --proto_path=PATH   Specify the directory in which to search for
                              imports.  May be specified multiple times;
                              directories will be searched in order.  If not
                              given, the current working directory is used.
                              If not found in any of the these directories,
                              the --descriptor_set_in descriptors will be
                              checked for required proto file.
  --version                   Show version info and exit.

......blahblah
Troy
@bbqchickenrobot
So whats the status of the .net project? Seems like its been a while since an update?
i get poor performances on this naive implementation
its benchmarking the use of a million actor passing around one message and incrementing its content
what can i do to improve the performance in a case like this? (we plan of having multiple millions of actors)
I suspect protoactor was not designed to handle this case, or am i missing something?