Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
nacardin committed Jul 11, 2024
1 parent 4aa9dc0 commit 11da307
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 78 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ jobs:
with:
key: windows-latest-test
- uses: cargo-bins/cargo-binstall@main
- uses: ilammy/setup-nasm@v1
- name: Install NASM for AWS-LC
uses: ilammy/setup-nasm@v1
- name: Install bindgen-cli
run: cargo install --force --locked bindgen-cli
- name: Test Setup
run: |
make certs
Expand All @@ -30,7 +33,6 @@ jobs:
- name: Test
run: |
Start-Process cmd -Args /c,"http-server --tls --tls-key certs/test-certs/server.key --tls-cert certs/test-certs/server.crt --tls-key-algorithm pkcs8"
cargo install --force --locked bindgen-cli
cargo test --features task,subscriber,fixture,task_unstable,io,sync,future,net,tls,rust_tls,timer,fs,zero_copy,mmap,retry
test:
name: Check ${{ matrix.check }} on (${{ matrix.os }})
Expand Down
19 changes: 7 additions & 12 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
# Release Notes

## Unreleased

* Timer sleeper only fires once ([#258](https://github.com/infinyon/future-aio/pull/258))
* Bump tokio from 1.33.0 to 1.37.0
* Bump async-lock from 2.8.0 to 3.3.0
* Bump async-fs from 1.6.0 to 2.1.2
* Bump bytes from 1.4.0 to 1.6.0
* Bump once_cell from 1.18.0 to 1.19.0
* Bump async-net from 1.7.0 to 2.0.0
* Bump async-native-tls from 0.4.0 to 0.5.0
* Bump memmap2 from 0.5.10 to 0.9.3
* Bump async-io from 1.13.0 to 2.3.2
## 0.7.0
* Update all depencencies to latest versions
* Timer sleeper only fires once
* Remove `http-client`
* Rename `native2_tls` feature to `native_tls`
* Note: `rustls` now uses `aws-lc` instead of `ring`


## 0.5.0
* Move to `memmap2` because `memmap` is unmaintained.
Expand Down
47 changes: 8 additions & 39 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,54 +12,23 @@ resolver = "2"
all-features = true

[features]
task = ["async-std/default", "timer", "cfg-if"]
subscriber = [
"tracing-subscriber",
"tracing-subscriber/std",
"tracing-subscriber/env-filter",
]
task = ["async-std/default", "cfg-if"]
subscriber = ["tracing-subscriber", "tracing-subscriber/std", "tracing-subscriber/env-filter"]
fixture = ["subscriber", "task", "fluvio-future-derive"]
task_unstable = ["task", "async-std/unstable"]
io = ["async-std/default"]
sync = ["async-std/default"]
future = ["async-std/default"]
net = [
"futures-lite",
"async-net",
"async-trait",
"cfg-if",
"futures-util/io",
"socket2",
"ws_stream_wasm"
]
net = ["futures-lite", "async-net", "async-trait", "cfg-if", "futures-util/io", "socket2", "ws_stream_wasm"]
tls = ["rust_tls"]
rust_tls = [
"net",
"rustls-pemfile",
"futures-rustls",
"pin-project",
"futures-util/io",
]
native_tls = [
"net",
"pin-project",
"async-native-tls",
"dep:native-tls",
"openssl/vendored",
"futures-util/io",
]
openssl_tls = [
"net",
"openssl",
"openssl-sys",
"pin-project",
"futures-util/io",
]
rust_tls = ["net", "rustls-pemfile", "futures-rustls", "pin-project", "futures-util/io"]
native_tls = ["net", "pin-project", "async-native-tls", "dep:native-tls", "openssl/vendored", "futures-util/io"]
openssl_tls = ["net", "openssl", "openssl-sys", "pin-project", "futures-util/io"]
timer = ["async-io", "pin-project", "futures-lite", "fluvio-wasm-timer"]
fs = ["async-fs", "futures-lite", "pin-utils", "async-trait"]
zero_copy = ["nix", "task_unstable"]
mmap = ["fs", "memmap2", "task_unstable"]
retry = []
retry = ["cfg-if"]
doomsday = ["task", "sync"]
tokio1 = ["async-std/tokio1"]
attributes = []
Expand Down Expand Up @@ -94,7 +63,7 @@ rustls-pemfile = { version = "2.1", optional = true }
socket2 = { version = "0.5.7", default-features = false, features = ["all"], optional = true }

[target.'cfg(target_arch = "wasm32")'.dependencies]
async-std = { version = "1.12.0", default-features = false, features = ["unstable"], optional = true }
async-std = { version = "1.12", default-features = false, features = ["unstable"], optional = true }
fluvio-wasm-timer = { version = "0.2.5", optional = true }
ws_stream_wasm = { version = "0.7.4", optional = true }

Expand Down
25 changes: 0 additions & 25 deletions src/task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ use std::future::Future;

use async_std::task;

use crate::timer::sleep;

#[cfg(feature = "task_unstable")]
pub use async_std::task::spawn_local;

Expand All @@ -16,29 +14,6 @@ where
task::block_on(spawn_closure);
}

/// run future and wait forever
/// this is typically used in the server
pub fn main_forever<F>(spawn_closure: F)
where
F: Future<Output = ()> + Send + 'static,
{
use std::time::Duration;

task::block_on(async {
spawn_closure.await;
// do infinite loop for now
loop {
cfg_if::cfg_if! {
if #[cfg(target_arch = "wasm32")] {
sleep(Duration::from_secs(3600)).await.unwrap();
} else {
sleep(Duration::from_secs(3600)).await;
}
}
}
});
}

cfg_if::cfg_if! {
if #[cfg(target_arch = "wasm32")] {
pub use async_std::task::spawn_local as spawn;
Expand Down

0 comments on commit 11da307

Please sign in to comment.