r/actix • • Jul 18 '19

Thank You! 🚀🥰

24 Upvotes

Thank you to the Actix Community and /u/fafhrd91 for all your hard work on Actix. I first started learning Rust at the beginning of the year and I was happy to find a project with such active development. You've personally answered some of my questions on GitHub and here. This is a great project despite what some of the more hardcore Rust community think.

I'm super happy to have found Actix and enjoy the plethora of examples and documentation. It's an awesome body of work!


r/actix • • Jun 06 '19

Word count with Actix, Kafka, and Redis

23 Upvotes

Hello folks,

One of the strengths of the Actix(-web) framework is the extensive suite of examples. I made up an example that demonstrates integration with Kafka (using rdlibkafka) and Redis (using redis). I'm planning to submit this to the actix/examples repo, but I thought I'd share it here first.

Repo: Kakfa-Actix-Example


r/actix • • Jun 03 '18

New intermediate TechEmpower results

Thumbnail
techempower.com
20 Upvotes

r/actix • • Feb 01 '22

actix-web published its first v4.0.0 release candidate

Thumbnail
github.com
17 Upvotes

r/actix • • Jun 12 '18

Rocket to Actix

Thumbnail
noyez.gitlab.io
15 Upvotes

r/actix • • Jun 07 '18

TechEmpower round 16

Thumbnail
self.rust
14 Upvotes

r/actix • • Jun 05 '18

Touring a Fast, Safe, and Complete(ish) Web Service in Rust

Thumbnail
brandur.org
14 Upvotes

r/actix • • Apr 27 '20

What's on the roadmap?

13 Upvotes

Pretty much the title :) What's coming? What's in the planning? What to expect in the future?


r/actix • • Sep 30 '18

Thumbcloud - A file-sharing server written in Actix-web

Thumbnail
github.com
13 Upvotes

r/actix • • Aug 24 '18

actix-lua - a safe scripting environment for Actix with the Lua Programming Language.

Thumbnail
github.com
13 Upvotes

r/actix • • Oct 05 '20

What is that difference? actix_rt / actix_web

12 Upvotes

I see in some manuals use "#[actix_web::main]" and in other "#[actix_rt::main]" what is the difference?

#[actix_rt::main]
async fn main() -> std::io::Result<()>

#[actix_web::main]
async fn main() -> std::io::Result<()> {


r/actix • • Aug 28 '19

Announcing actix-raft: Raft distributed consensus implemented using Actix

Thumbnail
self.rust
12 Upvotes

r/actix • • Nov 24 '19

How to write tests for actors?

11 Upvotes

I can't figure out what is the right way to test my actors. i would like to test them in two ways - the first one is testing the interval state of the actor after some message and the second one is to check the response for some existing message type. all i found in the documentation was Mocker which i didn't understand how to use. all i can think of for the first problem is writing a separate function which will return the interval state of the actor, and I'm not entirely sure how to write a unit test for the second problem, seems like i need to write integration tests, initiating all the actors in my application.


r/actix • • Jun 11 '18

actix – an actor framework for the Rust programming language

Thumbnail
simplabs.com
11 Upvotes

r/actix • • Jan 28 '19

Confused by documentation - When do I need actix::System?

10 Upvotes

I am going through the examples on the website. In the example for middleware - user sessions, actix::System is used, but I don't understand why.

Can someone explain me why it is being used there?


r/actix • • Oct 29 '18

Looking for suggestions about structuring an app

10 Upvotes

I'm new to Actix and to a slightly lesser extent Rust and was looking for some feedback about how best to structure an application. I think it's a little different than the standard API or site one might code using actix-web as I think it will need to mix lower level actix features. I'll start off by describing the non-front facing web part first and then go to the API bit:

- The "backend" is a client (let's call it DataClient) that needs to subscribe to an external high-volume data feed consumed over a tls socket (I'm guessing I'm going to have to do this with tokio?). It digests messages from the external feed and builds an aggregated dataset/cache. Nothing needs to be persisted to a database or the file system as a re-subcription to the feed can get a full image of the data needed to rebuild the state of the dataset. This needs to run persistently and handle disconnects, subscriptions, etc. Basically this part needs to:

  • subscribe (take a constant subscription config from the command line or config file, send subscription message)

  • receive stream of data (discrete messages) from external feed

  • process messages to build dataset/cache. This has to be done in the order the messages are received by a single processor/receiver.

  • periodically clean up cache as data is no longer relevant to avoid filling up memory (maybe once every few minutes, but could maybe be once an hour)

  • detect a disconnect to the external feed and resubscribe

- The web api handled by actix-web will have only a few simple endpoints that then pull different snapshots of the aggregated dataset/cache from the "backend client" and serve the results as json. The routes make read only access to the dataset/cache.

I have a sense that the cache (e.g DataClient) should probably be included in the actix_web App state as a Arc<Mutex<DataClient>> as suggested by https://github.com/actix/examples/blob/master/state/src/main.rs, although maybe this isn't necessary if it is accessed in a read-only way from the web api and there is only a single tls socket connection doing the updating.

A few general questions:

- Does this make sense to do in actix or does it seem to fall outside of actix's intended use-case?

- If this makes sense to do in actix, what would be the best way to structure the DataClient's functionality? Are the analogous examples out there that would be relevant?

Any suggestions or insight would be most appreciated.


r/actix • • Jul 11 '18

http://ruster.xyz/ Experiment online now. A CN online community written in Actix-web.

Thumbnail
ruster.xyz
10 Upvotes

r/actix • • Jun 09 '18

Puccinia: A self-hosted solution for accounting

10 Upvotes

https://github.com/jackpot51/puccinia

This is an early work in progress from the Redox OS creator, Jeremy Soller, recently converted to use Actix over Rocket. Takes advantage of Diesel & Handlebar templates.


r/actix • • Jun 05 '18

actix-multipart :Server handling of multipart data with actix-web

10 Upvotes

Actix Form Data

A library for retrieving form data from Actix Web's multipart streams. It can stream uploaded files onto the filesystem (its main purpose), but it can also parse associated form data.

https://github.com/asonix/actix-multipart


r/actix • • Sep 14 '21

Actix web 4

9 Upvotes

Does anyone know when the final version 4 of actix web will be released? 🤔


r/actix • • Nov 21 '18

Generic Methods in Rust: How Exonum Shifted from Iron to Actix-web

Thumbnail
medium.com
9 Upvotes

r/actix • • Jun 15 '18

yew-actix-protobuf-sample

Thumbnail
github.com
9 Upvotes

r/actix • • Feb 20 '23

For anyone trying to make actix_session work with extractors to get authenticated/protected routes . . .

8 Upvotes

Here is some code I wrote so someone can find it.

pub struct AuthenticatedUser;

impl actix_web::FromRequest for AuthenticatedUser {
    type Error = actix_web::Error;

    type Future = Pin<Box<dyn Future<Output = Result<Self, Self::Error>>>>;

    fn from_request(req: &actix_web::HttpRequest, payload: &mut actix_web::dev::Payload) -> Self::Future {
        let s = actix_session::Session::from_request(req, payload);
        let s = s.into_inner().unwrap();
        Box::pin(async move {
            if let Some(user) = s.get::<String>("username")? {
                Ok(AuthenticatedUser)
            } else {
                Err(actix_web::error::ErrorUnauthorized("Unauthorized"))
            }
        })
    }
}

Just put an AuthenticatedUser struct in your route params and you will be good.


r/actix • • Jul 26 '20

is it okay to do `tokio::spawn` in actix_web context or do I have to use actix_rt::spawn?

8 Upvotes

r/actix • • Jun 15 '18

Swipe app api with actix-web and graphql

Thumbnail
github.com
8 Upvotes