Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 12:39
    nagytech synchronize #4148
  • 12:27
    nagytech synchronize #4148
  • 04:57
    Aaronontheweb synchronize #4106
  • 02:45
    Aaronontheweb synchronize #4106
  • 02:43
    Aaronontheweb synchronize #4106
  • 02:30
    Aaronontheweb synchronize #4106
  • 00:24
    Aaronontheweb synchronize #4106
  • Jan 20 23:41
    Aaronontheweb opened #4150
  • Jan 20 22:07
    Aaronontheweb synchronize #4106
  • Jan 20 21:57
    IgorFedchenko synchronize #4126
  • Jan 20 21:32
    Aaronontheweb commented #4126
  • Jan 20 21:28
    IgorFedchenko commented #4126
  • Jan 20 21:24
    IgorFedchenko synchronize #4126
  • Jan 20 21:23
    IgorFedchenko synchronize #4126
  • Jan 20 21:09
    dependabot-preview[bot] labeled #4149
  • Jan 20 21:09
    dependabot-preview[bot] opened #4149
  • Jan 20 21:09

    dependabot-preview[bot] on nuget

    Bump Hyperion from 0.9.11 to 0.… (compare)

  • Jan 20 20:45

    Aaronontheweb on 1.3.17

    (compare)

  • Jan 20 20:44

    Aaronontheweb on master

    Bump AkkaVersion from 1.3.14 to… Bump Microsoft.NET.Test.Sdk fro… Bump System.Data.SqlClient from… and 11 more (compare)

  • Jan 20 20:44
    Aaronontheweb closed #134
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
you want the non-reentrant behavior
Andrew Skotzko
@skotzko
yeah you want the suspend behavior