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

Create a Rust actor library with high-level patterns, recovery, networking, sandboxing #613

Closed
steveklabnik opened this issue Jan 21, 2015 · 28 comments
Labels
A-community-library Area: The RFC is related to a community library. T-libs-api Relevant to the library API team, which will review and decide on the RFC.

Comments

@steveklabnik
Copy link
Member

Issue by brson
Monday Sep 24, 2012 at 20:46 GMT

For earlier discussion, see rust-lang/rust#3573

This issue was labelled with: A-an-interesting-project, A-concurrency, A-libs, I-wishlist, P-low in the Rust repository


Rust has a lot of powerful concurrency tools, but they aren't packaged up into a high-level, consistent interface.

Things that would be great in an actor library:

  • High-level help with implementing actor patterns, nice interface, minimal boilerplate
  • Cross-process actors with sandboxing. Sandboxing is very important to Servo, which has some initial sandboxing libraries.
  • Network-based messaging and actors
  • Reliable failure and recovery schemes. Rust has linked task failure, but no higher-level constructs to help users make use of it for creating reliable systems ala Erlang OTP.

Take inspiration from Scala, Akka and Erlang.

This probably isn't suitable for the main repo, but would be very useful for projects like Servo.

@carllerche
Copy link
Member

IMO this belongs in a dedicated crate and not the stdlib.

@steveklabnik steveklabnik added A-community-library Area: The RFC is related to a community library. and removed A-wishlist labels Mar 10, 2015
@steveklabnik
Copy link
Member Author

Tagging as 'community library' for exactly that reason.

@carllerche
Copy link
Member

I started work here: https://github.com/carllerche/astaire However, I am focusing on syncbox futures & streams at the moment. I think Futures & Streams will be a good abstraction to use with actors as well...

@victrcodes
Copy link

+1. Is this one in the right direction - https://github.com/withoutboats/Chekhov ?

@ayosec
Copy link

ayosec commented Dec 1, 2015

https://github.com/gamazeps/RobotS can be a good start

@gamazeps
Copy link

gamazeps commented Dec 8, 2015

@brson @steveklabnik @ayosec yay, i'm currently working on an actor library (the one linked above) and I was wondering what kind of features would be expected.

It currently mostly works on a single machine and has recovery (except for huge failures).

The only issue is that I currently have neither users nor use cases so I don't know what are the most desired features and thus I'm kinda working in the dark.

Would you have a list of stuff that would be nice to have (pretty please) ? Because once I'm done with the networking (in a week or two I guess) I will be out of ideas :/

@simbo1905
Copy link

@gamazeps I would suggest talking a look at Akka as a mature actor framework. There is a core lib which has actors, routers, dispatchers with supervision of crashed actors to manage local work. Then there are the remote extensions to do location transparency. Then there is clustering and server life cycle to be containers to do remote deployment of actors. That's all way, way too much and very much "everyone and the kitchen sink" but it has a good core library that can give good inspiration. My personal favourite is Akka FSM (finite state machine) where you define which matching functions apply to which state then have an API to switch states (hence matching functions) for the next message. So at this link is an actor which does Multi-Paxos for distributed consensus written as a FSM actor https://github.com/trex-paxos/trex/blob/codacy-changes/core/src/main/scala/com/github/simbo1905/trex/internals/PaxosActor.scala

@gamazeps
Copy link

gamazeps commented Dec 8, 2015

@simbo1905 yup, i'm quite aware of the akka library (I have read the documentation half a dozen time while implementing RobotS), this is the example / inspiration I have used this far, my question was more about which specific features in akka (or erlang, or any other actor framework) are the most desirable :)

As said before the "module", I'm gonna work next is the one for networking and location transparency.
I am wondering which next "modules" I should work on / improve, because as you said there are far too many and since I don't have a use case yet, I need to know where to prioritize my efforts :)

Thanks for the more than complete answer :)

@gsingh93
Copy link

gsingh93 commented Dec 8, 2015

@gamazeps That would be a great question to ask on the subreddit, or maybe the user forums. You'll find a lot more people there to discuss it.

@gamazeps
Copy link

gamazeps commented Dec 8, 2015

@gsingh93 fair enough :)

@norru
Copy link

norru commented Aug 2, 2016

I would go straight to http://doc.akka.io/docs/akka/snapshot/scala/typed.html :)

@gamazeps
Copy link

gamazeps commented Aug 2, 2016

That was my bedside book for a few weeks :)

@bfil
Copy link

bfil commented Sep 2, 2016

@gamazeps I was about to point you to this docs section of akka-typed in your blog post about Box (your Disqus comments section isn't loading though), but I guess you have already seen it then ;)

@gamazeps
Copy link

gamazeps commented Sep 2, 2016

Yeah I have to fix this comment section at some point...

Now that future-rs is out I guess that there is a way to get some of it in RobotS (their code is much better than mine).

@rogeralsing
Copy link

rogeralsing commented Dec 3, 2016

Is this still active?
I would like to propose this:
asynkron/protoactor-go#35

GAM is built on my experience building Akka.NET (port of Akka) I have reused the concepts that work well, and removed the parts that doesnt.
It could easily be ported to Rust.

@ghost
Copy link

ghost commented Dec 3, 2016

Hi, I think the actor library can be added to the stdlib, because:

  • It's a programming model, so it can be another choice to solve problem. It'd be more famous if it was in the stdlib.

  • Correct me, if I'm wrong. It can be used to create servers and that's a part of 2017 roadmap RFC.

  • Rust should be well-equipped for writing robust, high-scale servers

Why not:

  • It isn't very famous, so it may not be worth it.

It's my first comment in Rust. I hope you give me feedback to be better.

@gamazeps
Copy link

gamazeps commented Apr 8, 2017

For what it's worth I just published RobotS on crates.io.

It's still very rough, but works decently in a local environment (network is still missing).

I am currently working on a better typing of the actors (I'll try to publish the proposed solution on my website and here by the end of the weekend or next week), sorry if the library was not very active, real life was a bit overwhelming recently, and since no one used robots, I assumed it was not a priority.

@mrt181
Copy link

mrt181 commented Nov 9, 2017

maybe this can be a suitable jump start for actors: https://citybound.github.io/citybound/kay/index.html

@naturallymitchell
Copy link

Actix looks good.

@Centril Centril added the T-libs-api Relevant to the library API team, which will review and decide on the RFC. label Dec 10, 2017
@Centril
Copy link
Contributor

Centril commented Oct 7, 2018

Since actix et. al exists I'm closing this.

@Centril Centril closed this as completed Oct 7, 2018
@naturallymitchell
Copy link

Could we please reopen this to have some more discussion?

@Diggsey
Copy link
Contributor

Diggsey commented Apr 12, 2020

@naturallymitchell creating libraries is not something usually done via the RFC process, so this probably wouldn't be the best place to discuss it, unless you want to "bless" an existing actor library in some official way.

@mk270
Copy link

mk270 commented May 6, 2020

where is the appropriate place to discuss this (I'm guessing not here)?

@RustyYato
Copy link

@mk270 You can bring up a thread on https://internals.rust-lang.org/ if you want to get this into std. However, I don't think that will go over well because an actor framework is a huge investment for a std, and Rust likes to keep it's std small.

If you don't want to put this in std, then https://users.rust-lang.org/ can help out. You probably want to learn actix though. (and urlo can help you learn it)

@Diggsey
Copy link
Contributor

Diggsey commented May 6, 2020

@mk270 I would suggest creating something first be it a crate or a blog post explaining your ideas, get feedback on that via reddit, urlo, etc. see if more people are interested via those channels and then iterate.

@burdges
Copy link

burdges commented May 6, 2020

If you only want to discuss it right now then "create something" could mean a post on https://users.rust-lang.org/ discussing some existing attempts.

@naturallymitchell
Copy link

Hey guys, we can also discuss Actix on Discord: https://discord.gg/2A9h75V

@naturallymitchell
Copy link

Centril, Actix was a good choice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-community-library Area: The RFC is related to a community library. T-libs-api Relevant to the library API team, which will review and decide on the RFC.
Projects
None yet
Development

No branches or pull requests