Upgrade actix to 2.0 (fixes #392) #11

Manually merged
dessalines merged 2 commits from nutomic/lemmy:actix-2.0 into master 2020-01-12 00:42:33 +00:00
Owner

Cant say I understand the websocket code, but everything looks fine after these changes.

Docker build is failing, but that looks unrelated:

Compiling lazy_static v1.4.0
error: `core::slice::<impl [T]>::len` is not yet stable as a const fn
--> /home/rust/.cargo/registry/src/github.com-1ecc6299db9ec823/bytes-0.5.3/src/bytes.rs:121:18
|
121 |             len: bytes.len(),
|                  ^^^^^^^^^^^

error: aborting due to previous error

error: Could not compile `bytes`.
warning: build failed, waiting for other jobs to finish...
error: build failed
Cant say I understand the websocket code, but everything looks fine after these changes. Docker build is failing, but that looks unrelated: ``` Compiling lazy_static v1.4.0 error: `core::slice::<impl [T]>::len` is not yet stable as a const fn --> /home/rust/.cargo/registry/src/github.com-1ecc6299db9ec823/bytes-0.5.3/src/bytes.rs:121:18 | 121 | len: bytes.len(), | ^^^^^^^^^^^ error: aborting due to previous error error: Could not compile `bytes`. warning: build failed, waiting for other jobs to finish... error: build failed ```
Owner

Noice. I'll get to this soon.

Noice. I'll get to this soon.
Owner

This is missing the stuff in the routes folder I think, which also need to be made async.

BTW so my other project I added this sync code shown on actix's r2d2 example here: https://github.com/actix/examples/blob/master/r2d2/src/main.rs#L15

I'm not sure how to do that web::block for the websockets, but it should be easy to add for the nodeinfo, feeds, etc.

This is missing the stuff in the routes folder I think, which also need to be made async. BTW so my other project I added this sync code shown on actix's r2d2 example here: https://github.com/actix/examples/blob/master/r2d2/src/main.rs#L15 I'm not sure how to do that `web::block` for the websockets, but it should be easy to add for the nodeinfo, feeds, etc.
Author
Owner

Okay I made the functions async, based on this example. Not sure how the database thing should work, do we really need to modify every single function that makes a database call?

Okay I made the functions async, based on [this example](https://github.com/actix/examples/blob/master/async_ex1/src/main.rs). Not sure how the database thing should work, do we really need to modify every single function that makes a database call?
Author
Owner

FYI the Docker build issue is fixed by updating the version of rust-musl-builder in the Dockerfile. I will let you fix that to avoid having another open PR :p

https://github.com/tokio-rs/bytes/issues/323

FYI the Docker build issue is fixed by updating the version of `rust-musl-builder` in the Dockerfile. I will let you fix that to avoid having another open PR :p https://github.com/tokio-rs/bytes/issues/323
nutomic added a new dependency 2020-01-11 18:30:58 +00:00
Owner

Not sure how the database thing should work, do we really need to modify every single function that makes a database call?

Well the DB stuff always takes in &conn, so none of that's going to change at least.

I can handle this r2d2 stuff in another ticket tho, I made a issue for it here.

This looks good, imma test it shortly.

> Not sure how the database thing should work, do we really need to modify every single function that makes a database call? Well the DB stuff always takes in &conn, so none of that's going to change at least. I can handle this r2d2 stuff in another ticket tho, I made a [issue for it here](https://github.com/dessalines/lemmy/issues/409). This looks good, imma test it shortly.
dessalines closed this pull request 2020-01-12 00:42:33 +00:00
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Reference: LemmyNet/lemmy#11
No description provided.