Skip to content

[Question] How to send big data using the messaging system of actor? #153

Description

@Gabirel

Hi, I am new to the actor-based system. This is my first time to use the actor framework. And I really like riker. It is well-documented and elegant.

But, I ran into a serious issue several days ago and I don't know how to solve it.

How can I send big messages between actors? If I send the messages between actors, I have to derive Clone and Copy traits for the data structs which I used for wrapping messages. Clone is so a big issue to ignore, especially for big messages.

For example, I have a receiver actor for receiving TcpStream. Then the receiver actor processes it, stores some necessary information, and then pass it to the next actor for future processing.

It simply acts like this:

Big Big TcpStream --> receiver actor --> Big big struct (converted from receiver actor) --> A actor (recording some basic info) --> B actor (processes it, or stores it) --> End

So, in my opinion, it is not a good idea to pass big data struct around between actors. It could impact the performance greatly possibly. Maybe is it not a good idea to use an actor-based framework? Maybe I should just stick to the traditional threading methods?

Or, is it possible to pass the reference to that big data struct between actors? (maybe use a pool or something?)


PS:

  • I know this issue is not highly related to the riker itself. But it would be extremely helpful to point out something for me.
  • Are there some projects using riker right now? It will be really nice for me to imitate those codes. (Maybe it is also really nice for a newbie, like me.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions