Skip to content

Conversation

@mariusae
Copy link
Member

@mariusae mariusae commented Nov 20, 2025

Stack from ghstack (oldest at bottom):

We shouldn't mandate how an actor is actually instantiated. Rather, 'spawn' should just take over ownership of an Actor object directly, and run its loop from there. This helps to separate concerns and simplify the implementation. In this change:

  1. We remote new from Actor, and only require it in RemoteSpawn (renamed from RemotableActor), in order to enable remote spawning
  2. Change the spawn APIs to take ownership over an actor object
  3. Remote the derive(Actor) macro, this can now be implemented with a simple impl Actor for Foo{} marker trait when no additonal behavior needs to be customized.
  4. Simplify a bunch of actor construction, esp. in tests, where we like to just use simple objects.

Using this, in the next change, we will make spawn fully synchronous.

This leaves the #[export] attribute macro somewhat schizophrenic: spawn = true now only registers the actor in the remote registry. We should think about how to simplify this, too.

Differential Revision: D87575629

NOTE FOR REVIEWERS: This PR has internal Meta-specific changes or comments, please review them on Phabricator!

We shouldn't mandate how an actor is actually instantiated. Rather, 'spawn' should just take over ownership of an `Actor` object directly, and run its loop from there. This helps to separate concerns and simplify the implementation. In this change:

1) We remote `new` from `Actor`, and only require it in `RemoteSpawn` (renamed from `RemotableActor`), in order to enable remote spawning
2) Change the spawn APIs to take ownership over an actor object
3) Remote the `derive(Actor)` macro, this can now be implemented with a simple `impl Actor for Foo{}` marker trait when no additonal behavior needs to be customized.
4) Simplify a bunch of actor construction, esp. in tests, where we like to just use simple objects.

Using this, in the next change, we will make `spawn` fully synchronous.

This leaves the #[export] attribute macro somewhat schizophrenic: `spawn = true` now only registers the actor in the remote registry. We should think about how to simplify this, too.

Differential Revision: [D87575629](https://our.internmc.facebook.com/intern/diff/D87575629/)

**NOTE FOR REVIEWERS**: This PR has internal Meta-specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D87575629/)!

[ghstack-poisoned]
mariusae added a commit that referenced this pull request Nov 20, 2025
We shouldn't mandate how an actor is actually instantiated. Rather, 'spawn' should just take over ownership of an `Actor` object directly, and run its loop from there. This helps to separate concerns and simplify the implementation. In this change:

1) We remote `new` from `Actor`, and only require it in `RemoteSpawn` (renamed from `RemotableActor`), in order to enable remote spawning
2) Change the spawn APIs to take ownership over an actor object
3) Remote the `derive(Actor)` macro, this can now be implemented with a simple `impl Actor for Foo{}` marker trait when no additonal behavior needs to be customized.
4) Simplify a bunch of actor construction, esp. in tests, where we like to just use simple objects.

Using this, in the next change, we will make `spawn` fully synchronous.

This leaves the #[export] attribute macro somewhat schizophrenic: `spawn = true` now only registers the actor in the remote registry. We should think about how to simplify this, too.

Differential Revision: [D87575629](https://our.internmc.facebook.com/intern/diff/D87575629/)

**NOTE FOR REVIEWERS**: This PR has internal Meta-specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D87575629/)!

ghstack-source-id: 324832305
Pull Request resolved: #1962
@meta-cla meta-cla bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 20, 2025
We shouldn't mandate how an actor is actually instantiated. Rather, 'spawn' should just take over ownership of an `Actor` object directly, and run its loop from there. This helps to separate concerns and simplify the implementation. In this change:

1) We remote `new` from `Actor`, and only require it in `RemoteSpawn` (renamed from `RemotableActor`), in order to enable remote spawning
2) Change the spawn APIs to take ownership over an actor object
3) Remote the `derive(Actor)` macro, this can now be implemented with a simple `impl Actor for Foo{}` marker trait when no additonal behavior needs to be customized.
4) Simplify a bunch of actor construction, esp. in tests, where we like to just use simple objects.

Using this, in the next change, we will make `spawn` fully synchronous.

This leaves the #[export] attribute macro somewhat schizophrenic: `spawn = true` now only registers the actor in the remote registry. We should think about how to simplify this, too.

Differential Revision: [D87575629](https://our.internmc.facebook.com/intern/diff/D87575629/)

**NOTE FOR REVIEWERS**: This PR has internal Meta-specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D87575629/)!

[ghstack-poisoned]
mariusae added a commit that referenced this pull request Nov 21, 2025
Pull Request resolved: #1962

We shouldn't mandate how an actor is actually instantiated. Rather, 'spawn' should just take over ownership of an `Actor` object directly, and run its loop from there. This helps to separate concerns and simplify the implementation. In this change:

1) We remote `new` from `Actor`, and only require it in `RemoteSpawn` (renamed from `RemotableActor`), in order to enable remote spawning
2) Change the spawn APIs to take ownership over an actor object
3) Remote the `derive(Actor)` macro, this can now be implemented with a simple `impl Actor for Foo{}` marker trait when no additonal behavior needs to be customized.
4) Simplify a bunch of actor construction, esp. in tests, where we like to just use simple objects.

Using this, in the next change, we will make `spawn` fully synchronous.

This leaves the #[export] attribute macro somewhat schizophrenic: `spawn = true` now only registers the actor in the remote registry. We should think about how to simplify this, too.
ghstack-source-id: 324884139
@exported-using-ghexport

Differential Revision: [D87575629](https://our.internmc.facebook.com/intern/diff/D87575629/)

**NOTE FOR REVIEWERS**: This PR has internal Meta-specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D87575629/)!
We shouldn't mandate how an actor is actually instantiated. Rather, 'spawn' should just take over ownership of an `Actor` object directly, and run its loop from there. This helps to separate concerns and simplify the implementation. In this change:

1) We remote `new` from `Actor`, and only require it in `RemoteSpawn` (renamed from `RemotableActor`), in order to enable remote spawning
2) Change the spawn APIs to take ownership over an actor object
3) Remote the `derive(Actor)` macro, this can now be implemented with a simple `impl Actor for Foo{}` marker trait when no additonal behavior needs to be customized.
4) Simplify a bunch of actor construction, esp. in tests, where we like to just use simple objects.

Using this, in the next change, we will make `spawn` fully synchronous.

This leaves the #[export] attribute macro somewhat schizophrenic: `spawn = true` now only registers the actor in the remote registry. We should think about how to simplify this, too.

Differential Revision: [D87575629](https://our.internmc.facebook.com/intern/diff/D87575629/)

**NOTE FOR REVIEWERS**: This PR has internal Meta-specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D87575629/)!

[ghstack-poisoned]
We shouldn't mandate how an actor is actually instantiated. Rather, 'spawn' should just take over ownership of an `Actor` object directly, and run its loop from there. This helps to separate concerns and simplify the implementation. In this change:

1) We remote `new` from `Actor`, and only require it in `RemoteSpawn` (renamed from `RemotableActor`), in order to enable remote spawning
2) Change the spawn APIs to take ownership over an actor object
3) Remote the `derive(Actor)` macro, this can now be implemented with a simple `impl Actor for Foo{}` marker trait when no additonal behavior needs to be customized.
4) Simplify a bunch of actor construction, esp. in tests, where we like to just use simple objects.

Using this, in the next change, we will make `spawn` fully synchronous.

This leaves the #[export] attribute macro somewhat schizophrenic: `spawn = true` now only registers the actor in the remote registry. We should think about how to simplify this, too.

Differential Revision: [D87575629](https://our.internmc.facebook.com/intern/diff/D87575629/)

**NOTE FOR REVIEWERS**: This PR has internal Meta-specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D87575629/)!

[ghstack-poisoned]
We shouldn't mandate how an actor is actually instantiated. Rather, 'spawn' should just take over ownership of an `Actor` object directly, and run its loop from there. This helps to separate concerns and simplify the implementation. In this change:

1) We remote `new` from `Actor`, and only require it in `RemoteSpawn` (renamed from `RemotableActor`), in order to enable remote spawning
2) Change the spawn APIs to take ownership over an actor object
3) Remote the `derive(Actor)` macro, this can now be implemented with a simple `impl Actor for Foo{}` marker trait when no additonal behavior needs to be customized.
4) Simplify a bunch of actor construction, esp. in tests, where we like to just use simple objects.

Using this, in the next change, we will make `spawn` fully synchronous.

This leaves the #[export] attribute macro somewhat schizophrenic: `spawn = true` now only registers the actor in the remote registry. We should think about how to simplify this, too.

Differential Revision: [D87575629](https://our.internmc.facebook.com/intern/diff/D87575629/)

**NOTE FOR REVIEWERS**: This PR has internal Meta-specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D87575629/)!

[ghstack-poisoned]
We shouldn't mandate how an actor is actually instantiated. Rather, 'spawn' should just take over ownership of an `Actor` object directly, and run its loop from there. This helps to separate concerns and simplify the implementation. In this change:

1) We remote `new` from `Actor`, and only require it in `RemoteSpawn` (renamed from `RemotableActor`), in order to enable remote spawning
2) Change the spawn APIs to take ownership over an actor object
3) Remote the `derive(Actor)` macro, this can now be implemented with a simple `impl Actor for Foo{}` marker trait when no additonal behavior needs to be customized.
4) Simplify a bunch of actor construction, esp. in tests, where we like to just use simple objects.

Using this, in the next change, we will make `spawn` fully synchronous.

This leaves the #[export] attribute macro somewhat schizophrenic: `spawn = true` now only registers the actor in the remote registry. We should think about how to simplify this, too.

Differential Revision: [D87575629](https://our.internmc.facebook.com/intern/diff/D87575629/)

**NOTE FOR REVIEWERS**: This PR has internal Meta-specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D87575629/)!

[ghstack-poisoned]
We shouldn't mandate how an actor is actually instantiated. Rather, 'spawn' should just take over ownership of an `Actor` object directly, and run its loop from there. This helps to separate concerns and simplify the implementation. In this change:

1) We remote `new` from `Actor`, and only require it in `RemoteSpawn` (renamed from `RemotableActor`), in order to enable remote spawning
2) Change the spawn APIs to take ownership over an actor object
3) Remote the `derive(Actor)` macro, this can now be implemented with a simple `impl Actor for Foo{}` marker trait when no additonal behavior needs to be customized.
4) Simplify a bunch of actor construction, esp. in tests, where we like to just use simple objects.

Using this, in the next change, we will make `spawn` fully synchronous.

This leaves the #[export] attribute macro somewhat schizophrenic: `spawn = true` now only registers the actor in the remote registry. We should think about how to simplify this, too.

Differential Revision: [D87575629](https://our.internmc.facebook.com/intern/diff/D87575629/)

**NOTE FOR REVIEWERS**: This PR has internal Meta-specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D87575629/)!

[ghstack-poisoned]
We shouldn't mandate how an actor is actually instantiated. Rather, 'spawn' should just take over ownership of an `Actor` object directly, and run its loop from there. This helps to separate concerns and simplify the implementation. In this change:

1) We remote `new` from `Actor`, and only require it in `RemoteSpawn` (renamed from `RemotableActor`), in order to enable remote spawning
2) Change the spawn APIs to take ownership over an actor object
3) Remote the `derive(Actor)` macro, this can now be implemented with a simple `impl Actor for Foo{}` marker trait when no additonal behavior needs to be customized.
4) Simplify a bunch of actor construction, esp. in tests, where we like to just use simple objects.

Using this, in the next change, we will make `spawn` fully synchronous.

This leaves the #[export] attribute macro somewhat schizophrenic: `spawn = true` now only registers the actor in the remote registry. We should think about how to simplify this, too.

Differential Revision: [D87575629](https://our.internmc.facebook.com/intern/diff/D87575629/)

**NOTE FOR REVIEWERS**: This PR has internal Meta-specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D87575629/)!

[ghstack-poisoned]
We shouldn't mandate how an actor is actually instantiated. Rather, 'spawn' should just take over ownership of an `Actor` object directly, and run its loop from there. This helps to separate concerns and simplify the implementation. In this change:

1) We remote `new` from `Actor`, and only require it in `RemoteSpawn` (renamed from `RemotableActor`), in order to enable remote spawning
2) Change the spawn APIs to take ownership over an actor object
3) Remote the `derive(Actor)` macro, this can now be implemented with a simple `impl Actor for Foo{}` marker trait when no additonal behavior needs to be customized.
4) Simplify a bunch of actor construction, esp. in tests, where we like to just use simple objects.

Using this, in the next change, we will make `spawn` fully synchronous.

This leaves the #[export] attribute macro somewhat schizophrenic: `spawn = true` now only registers the actor in the remote registry. We should think about how to simplify this, too.

Differential Revision: [D87575629](https://our.internmc.facebook.com/intern/diff/D87575629/)

**NOTE FOR REVIEWERS**: This PR has internal Meta-specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D87575629/)!

[ghstack-poisoned]
We shouldn't mandate how an actor is actually instantiated. Rather, 'spawn' should just take over ownership of an `Actor` object directly, and run its loop from there. This helps to separate concerns and simplify the implementation. In this change:

1) We remote `new` from `Actor`, and only require it in `RemoteSpawn` (renamed from `RemotableActor`), in order to enable remote spawning
2) Change the spawn APIs to take ownership over an actor object
3) Remote the `derive(Actor)` macro, this can now be implemented with a simple `impl Actor for Foo{}` marker trait when no additonal behavior needs to be customized.
4) Simplify a bunch of actor construction, esp. in tests, where we like to just use simple objects.

Using this, in the next change, we will make `spawn` fully synchronous.

This leaves the #[export] attribute macro somewhat schizophrenic: `spawn = true` now only registers the actor in the remote registry. We should think about how to simplify this, too.

Differential Revision: [D87575629](https://our.internmc.facebook.com/intern/diff/D87575629/)

**NOTE FOR REVIEWERS**: This PR has internal Meta-specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D87575629/)!

[ghstack-poisoned]
We shouldn't mandate how an actor is actually instantiated. Rather, 'spawn' should just take over ownership of an `Actor` object directly, and run its loop from there. This helps to separate concerns and simplify the implementation. In this change:

1) We remote `new` from `Actor`, and only require it in `RemoteSpawn` (renamed from `RemotableActor`), in order to enable remote spawning
2) Change the spawn APIs to take ownership over an actor object
3) Remote the `derive(Actor)` macro, this can now be implemented with a simple `impl Actor for Foo{}` marker trait when no additonal behavior needs to be customized.
4) Simplify a bunch of actor construction, esp. in tests, where we like to just use simple objects.

Using this, in the next change, we will make `spawn` fully synchronous.

This leaves the #[export] attribute macro somewhat schizophrenic: `spawn = true` now only registers the actor in the remote registry. We should think about how to simplify this, too.

Differential Revision: [D87575629](https://our.internmc.facebook.com/intern/diff/D87575629/)

**NOTE FOR REVIEWERS**: This PR has internal Meta-specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D87575629/)!

[ghstack-poisoned]
We shouldn't mandate how an actor is actually instantiated. Rather, 'spawn' should just take over ownership of an `Actor` object directly, and run its loop from there. This helps to separate concerns and simplify the implementation. In this change:

1) We remote `new` from `Actor`, and only require it in `RemoteSpawn` (renamed from `RemotableActor`), in order to enable remote spawning
2) Change the spawn APIs to take ownership over an actor object
3) Remote the `derive(Actor)` macro, this can now be implemented with a simple `impl Actor for Foo{}` marker trait when no additonal behavior needs to be customized.
4) Simplify a bunch of actor construction, esp. in tests, where we like to just use simple objects.

Using this, in the next change, we will make `spawn` fully synchronous.

This leaves the #[export] attribute macro somewhat schizophrenic: `spawn = true` now only registers the actor in the remote registry. We should think about how to simplify this, too.

Differential Revision: [D87575629](https://our.internmc.facebook.com/intern/diff/D87575629/)

**NOTE FOR REVIEWERS**: This PR has internal Meta-specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D87575629/)!

[ghstack-poisoned]
We shouldn't mandate how an actor is actually instantiated. Rather, 'spawn' should just take over ownership of an `Actor` object directly, and run its loop from there. This helps to separate concerns and simplify the implementation. In this change:

1) We remote `new` from `Actor`, and only require it in `RemoteSpawn` (renamed from `RemotableActor`), in order to enable remote spawning
2) Change the spawn APIs to take ownership over an actor object
3) Remote the `derive(Actor)` macro, this can now be implemented with a simple `impl Actor for Foo{}` marker trait when no additonal behavior needs to be customized.
4) Simplify a bunch of actor construction, esp. in tests, where we like to just use simple objects.

Using this, in the next change, we will make `spawn` fully synchronous.

This leaves the #[export] attribute macro somewhat schizophrenic: `spawn = true` now only registers the actor in the remote registry. We should think about how to simplify this, too.

Differential Revision: [D87575629](https://our.internmc.facebook.com/intern/diff/D87575629/)

**NOTE FOR REVIEWERS**: This PR has internal Meta-specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D87575629/)!

[ghstack-poisoned]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot. fb-exported meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants