TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Actix – Actor Framework for Rust

185 pointsby Bella-Xiangover 5 years ago

13 comments

dmmover 5 years ago
The naming is a little confusing here. This is Actix the actor model library, not &quot;Actix web&quot; the web framework that&#x27;s usually discussed.<p>Originally &quot;Actix web&quot; depended on Actix the actor library, but no longer. Though they can be used together. And I think websockets still require actors?<p>I&#x27;m using both Actix and Actix web for a personal project. I like it a lot and think the actor model is good fit for applications that don&#x27;t fit well into a request lifecycle.<p>My main pain point with it is the use of futures. Right now it&#x27;s a huge pain to have more than one return value in an Actor Handler, the functions that handle actor messages. Even if you box the returned Future, you end up having to use futures::Either a bunch and when you mess it up you get tons of confusing errors filled with the huge inferred types.<p>Implementing something like:<p><pre><code> if (condition1) { return &lt;future for service call1&gt;; } else if (condition2) { return &lt;future for service call2&gt;; } else { return &lt;no-op future&gt;; } </code></pre> Is a big pain requiring two layers of future::Either. Or I just don&#x27;t know what I&#x27;m doing, which is very possible.<p>async&#x2F;await would be a huge improvement, but can&#x27;t be used at the moment, even though the current version of Actix uses std::future&#x27;s.
评论 #22317773 未加载
评论 #22319833 未加载
shawnzover 5 years ago
What is the difference between the actor model and object oriented programming? It seems to me like they are basically the same paradigm but with all the names changed, and some additional restrictions like all messages being async and objects only being able to process one message at a time. Why is it necessary to create a whole new paradigm just to enforce such a style?
评论 #22316819 未加载
评论 #22317362 未加载
评论 #22316731 未加载
评论 #22317801 未加载
评论 #22319225 未加载
评论 #22317155 未加载
评论 #22319398 未加载
评论 #22316717 未加载
评论 #22320248 未加载
评论 #22316841 未加载
habitueover 5 years ago
Highly recommend Bastion if you&#x27;re looking for a Rust Actor library &#x2F; runtime. It uses async&#x2F;await etc, and has supervision trees and restart strategies taken straight from Erlang&#x2F;OTP<p><a href="https:&#x2F;&#x2F;docs.rs&#x2F;bastion&#x2F;0.3.4&#x2F;bastion&#x2F;" rel="nofollow">https:&#x2F;&#x2F;docs.rs&#x2F;bastion&#x2F;0.3.4&#x2F;bastion&#x2F;</a><p><a href="https:&#x2F;&#x2F;github.com&#x2F;bastion-rs&#x2F;bastion" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;bastion-rs&#x2F;bastion</a>
评论 #22322563 未加载
dantodorover 5 years ago
I&#x27;m amazed on how much discussion digressed to actix-web. Understandable, seen the latest happenings there, but still... I tried quite a while ago Actix, coming from Erlang&#x2F;Elixir and Scala&#x2F;Akka. While the cognitive load of using it was not high, when I started my first test, I noticed one core being maxed out, and all others sleeping, which was kinda unusual for me. I asked why, and the author answered that it uses an event loop, so if you want it otherwise, go away and use something else, like Riker... So I went away :) ... I would assume this kind of behaviour has been corrected meanwhile (I mean the library, not the comms), because otherway, it&#x27;s just a Node written in Rust. My 2c :)
andrewzahover 5 years ago
Actix (the actor framework) is separate from what people are discussing here: actix-web, which <i>supports</i> actix). In earlier versions of actix-web it was based around actix; I remember implementing actors and handlers. Since 1.0 or so that got changed to more of a standard setup.<p>I’ll add my 2c on actix-web: in my opinion it tries to do too much. hyper (simply based on tokio) is all you need for a fast async server. Anecdotally, I know many people who basically use just this stack, over actix-web&#x2F;warp&#x2F;tower etc.<p>There are other actor systems, like kay [0].<p>[0]: <a href="https:&#x2F;&#x2F;citybound.github.io&#x2F;citybound&#x2F;kay&#x2F;index.html" rel="nofollow">https:&#x2F;&#x2F;citybound.github.io&#x2F;citybound&#x2F;kay&#x2F;index.html</a>
xedracover 5 years ago
I&#x27;m currently in the process of removing actix from one of my projects and replacing it with asyc&#x2F;await and some channels. Actix comes with a ton of dependencies and doesn&#x27;t buy you a whole lot anymore.
评论 #22324510 未加载
评论 #22319863 未加载
ncmncmover 5 years ago
Can somebody please summarize the outcome of the recent kerfuffle? I don&#x27;t mind which way it came out, but it seems worth knowing what it was.<p>I absolutely don&#x27;t want any even-slightly-inflammatory answer.
评论 #22316702 未加载
评论 #22316701 未加载
评论 #22322387 未加载
评论 #22317152 未加载
3fe9a03ccd14ca5over 5 years ago
I’m really excited about this project. Using Akka was one of those things that made distributed&#x2F;parallel execution just “click”. Particularly useful was being able to draw your architecture the same way one might draw an organization on a whiteboard. Everyone can quickly understand what happens and who is responsible for what.
polskibusover 5 years ago
Out of curiosity - actix seems to be very performant compared to actor frameworks implemented in other languages - would it be a good fit to implement a database using it? For example mapping worker pool and workers to actors?
评论 #22319933 未加载
smallstepformanover 5 years ago
Actors in principle (isolated objects assigned to threads) sound great until you need to SHARE data, then you enter a new universe of compromises where you need locking mechanisms (for performance), but no language semantics support it natively. Pony introduced reference capabilities but that still created a cludge for those times you needed synchronous access. There is no model yet where locking primitives are associated with resource handles.
评论 #22319787 未加载
评论 #22319648 未加载
walkingolofover 5 years ago
How does it stack up against more mature actor frameworks like Akka? (akka.io)
jamil7over 5 years ago
Whats the state of Rust if I wanted to get into it for backend development? I&#x27;ve looked briefly into Rocket and liked it but didn&#x27;t delve too deep, I understand Actix is one of the most mature?
评论 #22316676 未加载
评论 #22316885 未加载
评论 #22316587 未加载
评论 #22317990 未加载
评论 #22316697 未加载
评论 #22317003 未加载
评论 #22317395 未加载
评论 #22316833 未加载
评论 #22316728 未加载
dragonshover 5 years ago
This framework&#x27;s core developer has left, probably new community took it over. Hopefully it will continue to be supported and developed.<p>Rust still has a way to go for being a mature eco-system for doing any serious web programming work. Given the focus of Rust on systems programming, I will still be careful to consider it for anything web related.<p>Hopefully situations like abandoning a project suddenly will not happen again. [1] [2]<p>[1] <a href="https:&#x2F;&#x2F;words.steveklabnik.com&#x2F;a-sad-day-for-rust" rel="nofollow">https:&#x2F;&#x2F;words.steveklabnik.com&#x2F;a-sad-day-for-rust</a><p>[2] <a href="https:&#x2F;&#x2F;github.com&#x2F;actix&#x2F;actix-web&#x2F;issues&#x2F;1289" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;actix&#x2F;actix-web&#x2F;issues&#x2F;1289</a>
评论 #22316920 未加载
评论 #22316858 未加载
评论 #22316816 未加载