Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] - Generic RemoteActor #103

Open
caniko opened this issue Jan 1, 2025 · 4 comments
Open

[FEATURE] - Generic RemoteActor #103

caniko opened this issue Jan 1, 2025 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@caniko
Copy link

caniko commented Jan 1, 2025

Feature Description

Support generic RemoteActor through macro:

#[derive(Actor, RemoteActor)]
pub struct MyActor<G, P>

Motivation

My motivation is creating a library that depend on kameo for RemoteActor

Proposed Solution

TBD

Alternatives Considered

Just use Actor for now

@caniko caniko added the enhancement New feature or request label Jan 1, 2025
@tqwewe
Copy link
Owner

tqwewe commented Jan 5, 2025

I'll close this issue since I think supporting generics for remote actor messaging is simply not possible, since we can't know all the possible types supported by those generics.

The only work around is to not use generics and instead implement for each type manually.

@tqwewe tqwewe closed this as completed Jan 5, 2025
@tqwewe tqwewe added the wontfix This will not be worked on label Jan 5, 2025
@tqwewe
Copy link
Owner

tqwewe commented Jan 7, 2025

I'll reopen this one since it may be fine to have generic actors, despite generic messages not being solved.

A simple workaround is to just implement RemoteActor manually, its just got a const for the ID
https://docs.rs/kameo/latest/kameo/remote/trait.RemoteActor.html

@tqwewe tqwewe reopened this Jan 7, 2025
@tqwewe tqwewe removed the wontfix This will not be worked on label Jan 7, 2025
@caniko
Copy link
Author

caniko commented Jan 7, 2025

The scope of this issue is to allow users of the macro to define generic remote actors, correct?

@tqwewe
Copy link
Owner

tqwewe commented Jan 7, 2025

Yes thats correct, should be a simple fix for the macro. I'm just worried if there's something I'm missing which might make this be problematic but not too sure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants