Replace old custom async jobs framework with Rust's async #58

Closed
opened 2020-06-05 11:39:56 +03:00 by Manos Pitsidianakis · 0 comments

Before Rust had async support on stable, I wrote melib/src/async_workers.rs. All functions returning Async<_> results can be turned into async fns.

Prerequisites

  • trait async methods in rust stable (or use async_trait crate)
  • custom executor

Benefits

  • Interoperability with async libraries, for example http request libraries (reqwest)
  • Run Drop in executor thread for very very large objects to avoid UI process lag.
  • Cleaner API: Async<_> requires a lot of boilerplate for polling and result yielding
  • UI async requests for stuff that requires non-instant time
Before Rust had async support on stable, I wrote [`melib/src/async_workers.rs`](https://git.meli.delivery/meli/meli/src/branch/master/melib/src/async_workers.rs). All functions returning `Async<_>` results can be turned into `async fn`s. ### Prerequisites - [x] trait async methods in rust stable (or use `async_trait` crate) - [x] custom executor ### Benefits - [x] Interoperability with async libraries, for example http request libraries (`reqwest`) - [ ] Run `Drop` in executor thread for very very large objects to avoid UI process lag. - [x] Cleaner API: `Async<_>` requires a lot of boilerplate for polling and result yielding - [x] UI async requests for stuff that requires non-instant time
Manos Pitsidianakis added this to the beta milestone 2020-06-05 11:39:56 +03:00
Manos Pitsidianakis added the
enhancement
label 2020-06-05 11:39:56 +03:00
Manos Pitsidianakis modified the milestone from beta to async 2020-06-29 19:49:36 +03:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: meli/meli#58
There is no content yet.