Skip to content

Commit

Permalink
Rebase clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
TylerBloom committed Dec 21, 2023
1 parent edb11fa commit 78f4b0c
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 17 deletions.
2 changes: 1 addition & 1 deletion squire_core/src/state/accounts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use squire_sdk::{
};
use tokio::sync::oneshot::Sender as OneshotSender;
use tracing::Level;
use troupe::prelude::*;
use troupe::{prelude::*, sink::permanent::Tracker};

pub struct LoginError;

Expand Down
2 changes: 1 addition & 1 deletion squire_core/src/state/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ use tokio::sync::{
watch::{channel, Receiver as Watcher, Sender as Broadcaster},
};
use tracing::Level;
use troupe::prelude::*;
use troupe::{prelude::*, sink::permanent::Tracker};

#[derive(From)]
pub enum SessionCommand {
Expand Down
1 change: 0 additions & 1 deletion squire_core/src/tests/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ use http::{
header::{CONTENT_TYPE, SET_COOKIE},
Method,
};
use hyper::Body;
use serde::{de::DeserializeOwned, Serialize};
use squire_sdk::api::Url;
use tower::{Service, ServiceExt};
Expand Down
2 changes: 1 addition & 1 deletion squire_sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ headers = { version = "0.4", optional = true }
# To be moved
hashbag = { version = "0.1.11", features = ["serde"] }
derive_more = "0.99.17"
hyper = "0.14"
hyper = "1.0"
troupe = "0.1.0"

[target.'cfg(target_arch = "wasm32")'.dependencies]
Expand Down
3 changes: 1 addition & 2 deletions squire_sdk/src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::marker::PhantomData;
use serde::de::DeserializeOwned;
use squire_lib::{operations::OpResult, tournament::TournRole};
use tokio::sync::watch::Receiver as Subscriber;
use troupe::prelude::Tracker;
use troupe::sink::permanent::Tracker;

use self::{
builder::ClientBuilder,
Expand Down Expand Up @@ -74,7 +74,6 @@ impl UserInfo {
}
}

#[derive(Debug)]
pub struct SquireClient {
user: SessionWatcher,
client: NetworkClient,
Expand Down
8 changes: 4 additions & 4 deletions squire_sdk/src/client/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ use std::fmt::Debug;
use derive_more::From;

Check failure on line 3 in squire_sdk/src/client/network.rs

View workflow job for this annotation

GitHub Actions / Formatting Checks

Diff in /home/runner/work/SquireCore/SquireCore/squire_sdk/src/client/network.rs
use futures::SinkExt;
use squire_lib::{accounts::SquireAccount, tournament::TournamentId};
use troupe::prelude::{ActorState, Permanent, Scheduler, SinkActor};
use troupe::{prelude::*, compat::{SendableFuture, Sendable}};

use super::session::{SessionBroadcaster, SessionWatcher};
use crate::{
api::{Credentials, GetRequest, GuestSession, Login, PostRequest, SessionToken},
compat::{NetworkResponse, Websocket, WebsocketMessage, log},
api::{Credentials, GuestSession, Login, PostRequest, SessionToken},

Check failure on line 10 in squire_sdk/src/client/network.rs

View workflow job for this annotation

GitHub Actions / Formatting Checks

Diff in /home/runner/work/SquireCore/SquireCore/squire_sdk/src/client/network.rs
compat::{NetworkResponse, Websocket, WebsocketMessage, log, Client, Request, Response, NetworkError},
};

pub type NetworkClient = SyncClient<Permanent, NetworkCommand>;
pub type NetworkClient = SinkClient<Permanent, NetworkCommand>;

#[derive(Debug)]
pub struct NetworkState {
Expand Down
11 changes: 5 additions & 6 deletions squire_sdk/src/client/tournaments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ use squire_lib::{
tournament::TournamentId,
};
use tokio::sync::watch::{channel as watch_channel, Receiver as Watcher, Sender as Broadcaster};
use troupe::prelude::*;
use troupe::{prelude::*, sink::permanent::Tracker};
use uuid::Uuid;

use super::{network::NetworkState, OnUpdate};
use super::{network::NetworkCommand, OnUpdate};
use crate::{
compat::{log, Websocket, WebsocketError, WebsocketMessage, WebsocketResult},
sync::{
Expand All @@ -22,7 +22,7 @@ use crate::{
};

/// A container for the channels used to communicate with the tournament management task.
#[derive(Debug, Clone)]
#[derive(Clone)]
pub struct TournsClient {
client: SinkClient<Permanent, ManagementCommand>,
}
Expand Down Expand Up @@ -56,7 +56,6 @@ impl ActorState for ManagerState {
type Message = ManagementCommand;
type Output = ();


async fn process(&mut self, scheduler: &mut Scheduler<Self>, msg: Self::Message) {
match msg {
ManagementCommand::Query(id, query) => {
Expand Down Expand Up @@ -244,7 +243,7 @@ impl ManagerState {
let (sink, stream) = ws.split();
let (broad, sub) = watch_channel(());
entry.get_mut().comm = Some((sink, broad));
scheduler.add_stream(stream);
scheduler.attach_stream(stream.fuse());

Check warning on line 246 in squire_sdk/src/client/tournaments.rs

View check run for this annotation

Codecov / codecov/patch

squire_sdk/src/client/tournaments.rs#L246

Added line #L246 was not covered by tests
sub
}
},
Expand All @@ -257,7 +256,7 @@ impl ManagerState {
comm: Some((sink, broad)),
};
let _ = entry.insert(tc);
scheduler.add_stream(stream);
scheduler.attach_stream(stream.fuse());

Check warning on line 259 in squire_sdk/src/client/tournaments.rs

View check run for this annotation

Codecov / codecov/patch

squire_sdk/src/client/tournaments.rs#L259

Added line #L259 was not covered by tests
sub
}
}
Expand Down
1 change: 0 additions & 1 deletion squire_sdk/tests/server/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ use http::{
header::{CONTENT_TYPE, SET_COOKIE},
Method,
};
use hyper::Body;
use serde::{de::DeserializeOwned, Serialize};
use tower::Service;
Expand Down

0 comments on commit 78f4b0c

Please sign in to comment.