Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 17:27
    Aaronontheweb commented #90
  • 17:26
    Aaronontheweb commented #90
  • 17:25
    Aaronontheweb assigned #90
  • 17:16

    Aaronontheweb on dev

    Provide static GetRoutees.Insta… (compare)

  • 17:16
    Aaronontheweb closed #3974
  • 17:16
    Aaronontheweb milestoned #3974
  • 16:05
    jackowild opened #90
  • 15:08
    Aaronontheweb commented #3974
  • 15:08
    Aaronontheweb commented #3974
  • Oct 13 14:40
    cptjazz synchronize #3974
  • Oct 13 14:07
    cptjazz opened #3974
  • Oct 13 08:30
    ismaelhamed commented #3937
  • Oct 12 15:50
    IrvinDominin opened #127
  • Oct 11 18:21
    Aaronontheweb commented #3973
  • Oct 11 18:20
    Aaronontheweb commented #3937
  • Oct 11 18:16
    Zetanova commented #3937
  • Oct 11 18:11
    Zetanova commented #3937
  • Oct 11 15:09
    Aaronontheweb commented #3937
  • Oct 11 15:08
    Aaronontheweb commented #3937
  • Oct 11 14:36
    Aaronontheweb commented #3973
Andrew Skotzko
@skotzko
no worries :)
key thing is that your actor path needs to be right in the config, so double check that first
Daniel Ferreira Monteiro Alves
@danfma
ok
another question, let me say that I want to create some kind of processors on demand
I created a service with a queue of messages
the actors should pop some messages from time to time
Joshua Benjamin
@annymsMthd
Maybe a pooled router with a resizer?
Daniel Ferreira Monteiro Alves
@danfma
I was thinking in use the router to create that behaviour, while checking from time to time that queue
yes!
that's the point!
I created some actors using the async behaviour
Andrew Skotzko
@skotzko
i guess you could have one actor scheduled to receive messages off the queue and then hand them to a resizable pool router for scalable processing
s/them/the messages
Daniel Ferreira Monteiro Alves
@danfma
that's what the monitor is doing the previous code
the Executors is a pool of actors routed by the monitor
Andrew Skotzko
@skotzko
ah
ok
Daniel Ferreira Monteiro Alves
@danfma
one thing is funny
if I use the async from the .NET then the actors does not respect the default behaviour that only one message is processed by an actor at a time, apparenly
apparently*
is the the right thing when using async or a problem
Roger Johansson
@rogeralsing
What version are you using?
Daniel Ferreira Monteiro Alves
@danfma
the last one
just checking
Andrew Skotzko
@skotzko
default respects one message at at time
Roger Johansson
@rogeralsing
And what async behavior? Suspend or reentrant?
Natan Vivo
@nvivo
this async stuff must be a problem with Brazilians...
Andrew Skotzko
@skotzko
you have to specifically enable reentrant
Daniel Ferreira Monteiro Alves
@danfma
the version on nuget is the 1.0.0
yes, I configured that
kkkkkkkkkkkkk
is there another one here?
Natan Vivo
@nvivo
you should leave the default or specify Suspend
are you using ReceiveActor?
Daniel Ferreira Monteiro Alves
@danfma
yes
I will write one example here, just a moment
Natan Vivo
@nvivo
just do Receive<Foo>(async foo => { .. })
the default behavior is Suspend already
Roger Johansson
@rogeralsing
Btw async await is broken in nuget 1.0 package
Natan Vivo
@nvivo
oh, right!
Andrew Skotzko
@skotzko
but fix coming next week
in 1.0.1
Daniel Ferreira Monteiro Alves
@danfma
ahhhh
Natan Vivo
@nvivo
@danfma I'm Brazilian
Daniel Ferreira Monteiro Alves
@danfma
:D
me too
and good to say that was not a problem with me this time
:D
public class JobExecutor : ReceiveActor
    {
        private readonly Application _application;
        private bool _working = false;

        public JobExecutor(Application application)
        {
            _application = application;

            Receive<BeginWork>(AsyncBehavior.Reentrant, _ => _application.ExecuteInScope(() => OnBeginWork()));
        }

        private async Task OnBeginWork()
        {
            if (_working)
            {
                Console.WriteLine("Executando trabalho ainda {0}", Thread.CurrentThread.ManagedThreadId);
                return;
            }

            _working = true;

            Console.WriteLine("Iniciando trabalho {0}", Thread.CurrentThread.ManagedThreadId);
            //Thread.Sleep(8000);
            await Task.Delay(10000);
            Console.WriteLine("Finalizando trabalho {0}", Thread.CurrentThread.ManagedThreadId);

            _working = false;
        }
    }
Natan Vivo
@nvivo
Reentrant means exactly that messages will be processed during task awaits