summaryrefslogtreecommitdiff
path: root/exes
diff options
context:
space:
mode:
Diffstat (limited to 'exes')
-rw-r--r--exes/cache/Cargo.toml12
-rw-r--r--exes/gateway/Cargo.toml10
-rw-r--r--exes/gateway/src/lib.rs34
-rw-r--r--exes/ratelimit/Cargo.toml8
-rw-r--r--exes/rest/Cargo.toml14
-rw-r--r--exes/rest/src/handler.rs2
-rw-r--r--exes/webhook/Cargo.toml4
7 files changed, 44 insertions, 40 deletions
diff --git a/exes/cache/Cargo.toml b/exes/cache/Cargo.toml
index 7566c1b..ad8bca7 100644
--- a/exes/cache/Cargo.toml
+++ b/exes/cache/Cargo.toml
@@ -14,13 +14,13 @@ shared = { path = "../../libs/shared" }
proto = { path = "../../libs/proto" }
tokio = { version = "1", features = ["rt"] }
-tokio-stream = "0.1.11"
+tokio-stream = "0.1.14"
-serde = { version = "1.0.8", features = ["derive"] }
+serde = { version = "1.0.166", features = ["derive"] }
serde_json = { version = "1.0" }
-async-nats = "0.26.0"
-twilight-model = "0.14.2"
-anyhow = "1.0.68"
+async-nats = "0.29.0"
+twilight-model = "0.15.2"
+anyhow = "1.0.71"
-tracing = "0.1.37" \ No newline at end of file
+tracing = "0.1.37"
diff --git a/exes/gateway/Cargo.toml b/exes/gateway/Cargo.toml
index eeee408..da5cdec 100644
--- a/exes/gateway/Cargo.toml
+++ b/exes/gateway/Cargo.toml
@@ -17,8 +17,8 @@ anyhow = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
-tokio-stream = "0.1.11"
-twilight-gateway = { default-features = false, features = ["rustls-webpki-roots"], version = "0.14.1" }
-twilight-model = "0.14.2"
-bytes = "1.3.0"
-async-nats = "0.26.0"
+tokio-stream = "0.1.14"
+twilight-gateway = { default-features = false, features = ["rustls-webpki-roots"], version = "0.15.2" }
+twilight-model = "0.15.2"
+bytes = "1.4.0"
+async-nats = "0.29.0"
diff --git a/exes/gateway/src/lib.rs b/exes/gateway/src/lib.rs
index ddc4bbd..44fcce1 100644
--- a/exes/gateway/src/lib.rs
+++ b/exes/gateway/src/lib.rs
@@ -20,9 +20,8 @@ use shared::{
};
use std::{convert::TryFrom, future::Future, pin::Pin, str::FromStr};
use tokio::{select, sync::oneshot};
-use tokio_stream::StreamExt;
use tracing_opentelemetry::OpenTelemetrySpanExt;
-use twilight_gateway::{Event, Shard};
+use twilight_gateway::{Event, Shard, ShardId};
pub mod config;
use tracing::{debug, error, info, info_span, instrument, Instrument};
use twilight_model::gateway::event::DispatchEvent;
@@ -47,25 +46,32 @@ impl Component for GatewayServer {
mut stop: oneshot::Receiver<()>,
) -> AnyhowResultFuture<()> {
Box::pin(async move {
- let (shard, mut events) = Shard::builder(settings.token.clone(), settings.intents)
- .shard(settings.shard, settings.shard_total)?
- .build();
+ let mut shard = Shard::new(
+ ShardId::new(settings.shard, settings.shard_total),
+ settings.token.clone(),
+ settings.intents,
+ );
let nats = Into::<Pin<Box<dyn Future<Output = anyhow::Result<Client>> + Send>>>::into(
settings.nats,
)
.await?;
- shard.start().await?;
loop {
select! {
- event = events.next() => {
- if let Some(event) = event {
- let _ = handle_event(event, &nats)
- .await
- .map_err(|err| error!(error = ?err, "event publish failed"));
- } else {
- break
+ event = shard.next_event() => {
+ match event {
+ Ok(event) => {
+ let _ = handle_event(event, &nats)
+ .await
+ .map_err(|err| error!(error = ?err, "event publish failed"));
+ },
+ Err(source) => {
+ if source.is_fatal() {
+ break;
+ }
+ continue;
+ }
}
},
_ = (&mut stop) => break
@@ -73,8 +79,6 @@ impl Component for GatewayServer {
}
info!("stopping shard...");
- shard.shutdown();
-
Ok(())
})
}
diff --git a/exes/ratelimit/Cargo.toml b/exes/ratelimit/Cargo.toml
index 079ec50..3c4d386 100644
--- a/exes/ratelimit/Cargo.toml
+++ b/exes/ratelimit/Cargo.toml
@@ -20,10 +20,10 @@ serde = { workspace = true }
serde_json = { workspace = true }
hyper = { workspace = true }
-twilight-http-ratelimiting = "0.14.2"
-tonic = "0.8.3"
-tokio-stream = "0.1.11"
-redis = { version = "0.22.1", features = ["cluster", "connection-manager", "tokio-comp"] }
+twilight-http-ratelimiting = "0.15.1"
+tonic = "0.9.2"
+tokio-stream = "0.1.14"
+redis = { version = "0.23.0", features = ["cluster", "connection-manager", "tokio-comp"] }
[dev-dependencies]
criterion = { workspace = true }
diff --git a/exes/rest/Cargo.toml b/exes/rest/Cargo.toml
index d058a73..855167d 100644
--- a/exes/rest/Cargo.toml
+++ b/exes/rest/Cargo.toml
@@ -20,13 +20,13 @@ serde = { workspace = true }
serde_json = { workspace = true }
hyper = { workspace = true }
-futures-util = "0.3.17"
-hyper-rustls = "0.23.2"
+futures-util = "0.3.28"
+hyper-rustls = "0.24.1"
lazy_static = "1.4.0"
-xxhash-rust = { version = "0.8.2", features = ["xxh32"] }
-twilight-http-ratelimiting = "0.14.2"
+xxhash-rust = { version = "0.8.6", features = ["xxh32"] }
+twilight-http-ratelimiting = "0.15.1"
hashring = "0.3.0"
-tonic = "0.8.3"
-tokio-stream = "0.1.11"
-dns-lookup = "1.0.8"
+tonic = "0.9.2"
+tokio-stream = "0.1.14"
+dns-lookup = "2.0.2"
diff --git a/exes/rest/src/handler.rs b/exes/rest/src/handler.rs
index c80132f..cd867fe 100644
--- a/exes/rest/src/handler.rs
+++ b/exes/rest/src/handler.rs
@@ -18,7 +18,7 @@ use std::{
sync::Arc,
time::SystemTime,
};
-use tracing::{debug_span, error, info_span, log::trace, Instrument};
+use tracing::{debug_span, error, info_span, trace, Instrument};
use twilight_http_ratelimiting::{Method, Path};
use crate::{config::ReverseProxy, ratelimit_client::RemoteRatelimiter};
diff --git a/exes/webhook/Cargo.toml b/exes/webhook/Cargo.toml
index f601a66..5bcc550 100644
--- a/exes/webhook/Cargo.toml
+++ b/exes/webhook/Cargo.toml
@@ -16,6 +16,6 @@ anyhow = { workspace = true }
hex = "0.4.3"
ed25519-dalek = "1"
-twilight-model = "0.14.2"
+twilight-model = "0.15.2"
-async-nats = "0.26.0"
+async-nats = "0.29.0"