Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Feb 17 19:13

    robjtede on master

    tweak migration document (compare)

  • Feb 17 08:12
    stanley355 commented #2650
  • Feb 17 01:07
    stanley355 commented #2650
  • Feb 16 14:10
    robjtede commented #2650
  • Feb 16 14:09
    robjtede labeled #2650
  • Feb 16 14:09
    robjtede closed #2650
  • Feb 16 14:09
    robjtede commented #2650
  • Feb 16 12:53
    stanley355 opened #2650
  • Feb 16 03:44

    github-actions[bot] on gh-pages

    Deploying to gh-pages from @ 5… (compare)

  • Feb 16 03:32

    github-actions[bot] on gh-pages

    Deploying to gh-pages from @ f… (compare)

  • Feb 16 03:13

    robjtede on test-v0.1.0-beta.13

    (compare)

  • Feb 16 03:13

    robjtede on http-test-v3.0.0-beta.13

    (compare)

  • Feb 16 03:13

    robjtede on master

    prepare actix-http-test release… prepare actix-test release 0.1.… (compare)

  • Feb 16 03:13

    github-actions[bot] on gh-pages

    Deploying to gh-pages from @ a… (compare)

  • Feb 16 03:11

    robjtede on actors-v4.0.0-beta.12

    (compare)

  • Feb 16 03:11

    robjtede on master

    prepare actix-web-actors releas… (compare)

  • Feb 16 03:10

    robjtede on awc-v3.0.0-beta.21

    (compare)

  • Feb 16 03:10

    robjtede on master

    prepare awc release 3.0.0-beta.… (compare)

  • Feb 16 03:07

    robjtede on http-v3.0.0-rc.3

    (compare)

  • Feb 16 03:07

    robjtede on master

    prepare actix-http release 3.0.… (compare)

Mehmet ERİBOL
@mehmeteribol_gitlab
They are all using same host resource(postgres, redis etc). Thank you so much.
Kunjan Dalal
@kunjee17
if I m having static site generated using separate framework like nextjs and I want to map files to url? What is best way to do it with actix and actix-files. I can easily map index files and works well when there is hash routing and SPA. But I couldn't make it work with generated static site.
2 replies
ieow
@ieow

Hey guys,
I am trying to use SSE (server send events) with code below
when browser try to subscribe, it is just stuck till timeout. (req timeout)

#[get("/events")]
async fn event( broadcaster: web::Data<Mutex<Broadcaster>>) -> impl Responder {
    println!("enter events locking broadcaster"); 
    let mut map : HashMap<String, String> = HashMap::new();
    map.insert("status".to_string() , "connected".to_string());
    let rx = broadcaster.lock().unwrap().new_client( map );
    println!("add newclient");

    HttpResponse::Ok()
    .header("content-type", "text/event-stream")
    // .no_chunking(64)
    .streaming(rx)
}

I trace it, it reach HttpResponse::Ok and stuck there
I wonder if the no_chunking is required?

1 reply
Kunjan Dalal
@kunjee17

May be mostly dumb question.

if I want to achieve organizations/{id}/providers/{id} url. Then I need to add providers config on organizations/{id} web scope ? or I am thinking completely wrong ?

7 replies
Dmitry Miasnenko
@clowzed
Hello everyone! I need too implement a function which runs in interval. I've found solutions like actix_web::rt::spawn and others but I cannot access app_data inside this function. Any suggestions?
2 replies
Ashanti Mutinta
@AshantiMutinta
I'm looking for some resources were I can read about the actix event loop. Bonus points if it also mentions how this corresponds with actix-web
Ashanti Mutinta
@AshantiMutinta
Woops found this thank you all https://actix.rs/book/actix/sec-5-arbiter.html
Ashanti Mutinta
@AshantiMutinta
Actix-web uses the number of logical cpus to allocate the number of workers. If I use an actor with an async arbiter, where does that execute?
1 reply
AsyncContext* I guess
Ashanti Mutinta
@AshantiMutinta
Hmmmm I start it in the main of my actix-rt::main
1 reply
Actix_web::main*
Great thank you
Ashanti Mutinta
@AshantiMutinta
Also sorry for the dumb question but I'd the actix-web creates the workers according to the logical cpus does it leave one for it "main thread" execution?
1 reply
Sick! Is that the reason why it doesn't spawn n-1 threads because the main one is mostly idle? In my mind I was thinking maybe it wants to leave a thread for itself but if it mostly idle then that is fine I think
1 reply
Ashanti Mutinta
@AshantiMutinta
This is great information thank you! I an starting to look at the code so I'm just very curious it's an awesome project
Ashanti Mutinta
@AshantiMutinta
Does each request go through the acceptor thread which then passes it off to one of the workers queues?
1 reply
Ashanti Mutinta
@AshantiMutinta
Awesome
Kunjan Dalal
@kunjee17
What would be better option if I need something like actor system (for logical separation not performance)? Actix actors or Tokio message channel. Tokio is already included in actix-web but actix actors needed to be added as separate package. AFAIK.
Ashanti Mutinta
@AshantiMutinta
What does everyone use to profile actix? Having a hard time with cargo flame graphics because of the extra symbols
Ashanti Mutinta
@AshantiMutinta
Actix-web apps *
fakeshadow
@fakeshadow
I use cargo flame. You just have to get used to the tokio stacks and foucs on the very top of the graph.
Mehmet ERİBOL
@mehmeteribol_gitlab
but i am using actix-beta. is there examples for beta?
Mehmet ERİBOL
@mehmeteribol_gitlab
i am tring to change but there is a lot of changes in beta
Ashanti Mutinta
@AshantiMutinta
What is the benefit of using awc vs reqwest?
asonix (he/they)
@asonix:matrix.asonix.dog
[m]
fewer dependencies :)
it uses the same HTTP stack as actix web
I generally prefer to use awc in my projects
also built-in middlewares is very cool. in reqwest land you need an additional wrapper package reqwest-middleware for that
Ashanti Mutinta
@AshantiMutinta
Awesome thank you!
Biswas Sampad
@biswassampad
Hi Does the actix_rt is required to asyn functions while using actix-web 3 ?
2 replies
vaelio
@vaelio:matarch.fr
[m]
Hello every one
Im trying to make a proxy using actix and while the core functionality works fine i struggle to get the raw data from a HttpRequest (the point being to print it into the user so that he can reproduce/modify the request.
Chris Allison
@ToferC
Hi folks. I'm trying to set up my actix-web app with Docker. I've got the images and containers working, but can't find a way to connect to localhost. I've scoured all of the usual sites, published ports, tried host network, etc., but while the issue seems to be that while the requests are going in, actix isn't serving the response. Has anyone experienced anything like this? Repo is here: https://github.com/ToferC/health_rules_engine
10 replies
asonix (he/they)
@asonix:matrix.asonix.dog
[m]
from a quick glance: everything looks correct. that's certainly a weird bug
binding to 0.0.0.0 inside the container is the right thing to do
i notice you're mappinng 18080 to 8080 in the docker-compose, but that should be okay
what OS / environment are you running this in? is it just linux, or is it macos with docker desktop or windows with wsl
Chris Allison
@ToferC
I’ve tried other port routings and same result. My default is 8088:8088. My base is using docker desktop for Mac and ive tested the same thing on Wsl2 / Ubuntu on my Windows machine.
When watching the traffic, i can see small (2k) traffic going in, but nothing comes back out and ive got a no response screen on browser and nada in console.
Félix
@felix.maneville:qonfucius.team
[m]
Should every endpoint function be async ? Or is it not useful?
1 reply
Xu Desheng
@xudesheng
I'm looking for an example for this use case: 1) website assets have been ready: index.html (1k), index.js(315k), wasm.js(9k), xxx.wasm(300k). 2) I want all assets can be provided as gzip. 3) I want all assets can be automatically gzipped during compiling time and it's part of the final binary file. 4) with this kind of setting, actix-web doesn't need to zip the assets during runtime but still can provide gzipped format to the client. Do we have this kind of example? Thanks.
nicolaujr
@nicolaujr
Hi, I'm looking for a example to setup the X_FRAME_OPTIONS on my server
Could't find anything in the docs
anyone can give me some direction?
Do I need to create a custom middleware to inject the header in every response?
nicolaujr
@nicolaujr
Just found the DefaultHeaders middleware, if anyone is interested
Roshan Rajan
@roshanjrajan
Hi! I was wondering if it is possible to extract the path name to be used for logging purposes. I have many of these created but wanted to keep track of what requests are hit the most. Is there a way to get this information? I am looking to get the string "/api/endpoint1" in the example below.
#[get("/api/endpoint1")] 
async fn api_request() -> Result<String> {
    Ok(String::from("Hello World"))
}
Mehmet ERİBOL
@mehmeteribol_gitlab
Hi. I am using v4 beta 10. It was working couple of days ago but now i get error like this;
#[post("/login")]
async fn post_login(user: Data<LoginUser>) -> Result<HttpResponse, Error> {
    Ok(HttpResponse::Ok().json(1))
}
.service(web::resource("/login").route(web::post().to(post_login)))
   |                                                                -- ^^^^^^^^^^ the trait `Handler<_, _>` is not implemented for `post_login`
   |                                                                |
   |                                                                required by a bound introduced by this call
CKalt
@CKalt
Anyone know how to capture type mismatch errors that result when using the Path information extractor so that I can produce a custom JSON format result instead of the default. For example I would like wrap the default error that gets emited like "Query deserialize error: invalid digit found in string" in a JSON object. But from the doc I'm not seeing how I might do this. I see a section on how to generate my own custom errors, but not how to capture and customize the default errors. Thank you for your help!!
2 replies