ordering messages

12 views
Skip to first unread message

Mats Johnson

unread,
Jul 9, 2021, 6:59:36 AM7/9/21
to actor-framework
I'm considering if it would be possible to do something like this:
1) think of message types as "ports" connected to some other actor
2) add some kind of ordering value (like a timestamp) to every message
3) buffer messages and wait until there are buffered messages on each port, then process the one with the lowest timestamp

What might be a good strategy to achieve something like that?

Dominik Charousset

unread,
Jul 11, 2021, 3:20:25 AM7/11/21
to actor-f...@googlegroups.com
There’s not a particular CAF feature that I could recommend. I’d probably just have one list/queue at the actor for each port. In the message handler, push to the appropriate list/queue and call some processing function if each one has at least one item.

Dominik

Mats Johnson

unread,
Jul 12, 2021, 4:13:44 AM7/12/21
to actor-f...@googlegroups.com
Yes, would it be reasonable to create some kind of template wrapper to do that for 100s of actors? I’d want to use typed actors, but the wrapper would need to be more generic in implementation I suppose, but still be typed on the “outside”.

> 11 juli 2021 kl. 09:20 skrev Dominik Charousset <dom...@charousset.de>:
>
> 
> --
> You received this message because you are subscribed to a topic in the Google Groups "actor-framework" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/actor-framework/viEC3H2biNk/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to actor-framewo...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/actor-framework/6DEACC7F-1C4F-41F3-84A6-E9FB268A6A82%40charousset.de.

Dominik Charousset

unread,
Jul 13, 2021, 7:12:41 AM7/13/21
to actor-f...@googlegroups.com
> Yes, would it be reasonable to create some kind of template wrapper to do that for 100s of actors? I’d want to use typed actors, but the wrapper would need to be more generic in implementation I suppose, but still be typed on the “outside”.

Do you really have hundreds of actor types, or rather hundreds of possible message types?

Did you build a small prototype for what you’re trying to build? Without code I find it difficult to understand where you want to go with this idea.

Dominik

Mats Johnson

unread,
Jul 13, 2021, 7:19:50 AM7/13/21
to actor-f...@googlegroups.com
I understand, yes, I think I’ll need to create a prototype.

> 13 juli 2021 kl. 13:12 skrev Dominik Charousset <dominik.c...@cafcademy.com>:
>
> 
> --
> You received this message because you are subscribed to a topic in the Google Groups "actor-framework" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/actor-framework/viEC3H2biNk/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to actor-framewo...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/actor-framework/0F0474BC-CAF5-40BF-A94B-DAB44406A313%40cafcademy.com.
Reply all
Reply to author
Forward
0 new messages