Skip to content

Commit 4a0b739

Browse files
committed
Removed Io type def export.
1 parent 7c261dc commit 4a0b739

File tree

10 files changed

+20
-15
lines changed

10 files changed

+20
-15
lines changed

runtime/swimos_runtime/src/agent/mod.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ use std::{
4949
time::Duration,
5050
};
5151

52-
use crate::downlink::DownlinkOptions;
52+
use crate::{downlink::DownlinkOptions, Io};
5353

5454
use self::{
5555
reporting::{UplinkReportReader, UplinkReporter},
@@ -294,8 +294,6 @@ impl AgentContext for AgentRuntimeContext {
294294
}
295295
}
296296

297-
/// Ends of two independent channels (for example the input and output channels of an agent).
298-
type Io = (ByteWriter, ByteReader);
299297

300298
/// Reasons that a remote connected to an agent runtime task could be disconnected.
301299
#[derive(Debug, Clone, Copy, PartialEq, Eq)]

runtime/swimos_runtime/src/agent/task/external_links/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@ use tracing::{debug, error, trace};
4545
use uuid::Uuid;
4646

4747
use crate::{
48-
agent::{CommanderKey, CommanderRequest, DownlinkRequest, LinkRequest},
49-
downlink::Io,
48+
agent::{CommanderKey, CommanderRequest, DownlinkRequest, LinkRequest}, Io,
5049
};
5150

5251
use super::{AdHocChannelRequest, ExternalLinkRequest};

runtime/swimos_runtime/src/agent/task/external_links/tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use crate::{
1919
task::{external_links, AdHocChannelRequest, ExternalLinkRequest},
2020
CommanderKey, CommanderRequest, DownlinkRequest, LinkRequest,
2121
},
22-
downlink::{DownlinkOptions, Io},
22+
downlink::DownlinkOptions, Io,
2323
};
2424
use bytes::Bytes;
2525
use futures::{

runtime/swimos_runtime/src/downlink/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ use std::time::Duration;
1818

1919
use crate::downlink::failure::BadFrameResponse;
2020
use crate::timeout_coord::{VoteResult, Voter};
21+
use crate::Io;
2122
use backpressure::DownlinkBackpressure;
2223
use bitflags::bitflags;
2324
use bytes::{Bytes, BytesMut};
@@ -78,8 +79,6 @@ bitflags! {
7879
}
7980
}
8081

81-
pub type Io = (ByteWriter, ByteReader);
82-
8382
impl WriteTaskState {
8483
/// If a new consumer needs to be synced, set the appropriate state bit.
8584
pub fn set_needs_sync(&mut self, options: DownlinkOptions) {

runtime/swimos_runtime/src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,14 @@
1818
//! the Warp protocol only and are entirely decoupled from the state and user defined behaviour
1919
//! of the the agents/downlinks.
2020
21+
use swimos_utilities::byte_channel::{ByteReader, ByteWriter};
22+
2123
/// The agent runtime task.
2224
pub mod agent;
2325
mod backpressure;
2426
/// The downlink runtime task.
2527
pub mod downlink;
2628
mod timeout_coord;
29+
30+
/// Ends of two independent channels (for example the input and output channels of an agent).
31+
type Io = (ByteWriter, ByteReader);

server/swimos_introspection/src/meta_mesh/mod.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ use swimos_form::read::{ReadError, ReadEvent, Recognizer, RecognizerReadable};
3333
use swimos_form::write::{StructuralWritable, StructuralWriter};
3434
use swimos_form::Form;
3535
use swimos_model::Text;
36-
use swimos_runtime::downlink::Io;
37-
use swimos_utilities::routing::RouteUri;
36+
use swimos_utilities::{byte_channel::{ByteReader, ByteWriter}, routing::RouteUri};
3837
use swimos_utilities::trigger;
3938
use tokio_util::codec::{FramedRead, FramedWrite};
4039

@@ -205,6 +204,8 @@ impl RecognizerReadable for NodeInfo {
205204
}
206205
}
207206

207+
type Io = (ByteWriter, ByteReader);
208+
208209
async fn run_task(
209210
shutdown_rx: trigger::Receiver,
210211
agents: Arc<RwLock<UriForest<AgentMeta>>>,

server/swimos_server_app/src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,6 @@ pub mod introspection {
3030
}
3131

3232
pub use ratchet::deflate::DeflateConfig;
33+
use swimos_utilities::byte_channel::{ByteReader, ByteWriter};
34+
35+
type Io = (ByteWriter, ByteReader);

server/swimos_server_app/src/server/runtime/downlinks/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ use swimos_runtime::{
4343
agent::{CommanderKey, CommanderRequest, DownlinkRequest, LinkRequest},
4444
downlink::{
4545
failure::{AlwaysAbortStrategy, AlwaysIgnoreStrategy, ReportStrategy},
46-
AttachAction, DownlinkRuntimeConfig, Io, MapDownlinkRuntime, ValueDownlinkRuntime,
46+
AttachAction, DownlinkRuntimeConfig, MapDownlinkRuntime, ValueDownlinkRuntime,
4747
},
4848
};
4949
use swimos_utilities::{
@@ -56,7 +56,7 @@ use tokio::{
5656
};
5757
use uuid::Uuid;
5858

59-
use crate::server::runtime::downlinks::pending::Waiting;
59+
use crate::{server::runtime::downlinks::pending::Waiting, Io};
6060

6161
use super::{
6262
ids::{IdIssuer, IdKind},

server/swimos_server_app/src/server/runtime/downlinks/tests.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ use swimos_remote::dns::{DnsFut, DnsResolver};
4444
use swimos_remote::SchemeHostPort;
4545
use swimos_runtime::{
4646
agent::{CommanderKey, CommanderRequest, DownlinkRequest, LinkRequest},
47-
downlink::{DownlinkOptions, DownlinkRuntimeConfig, Io},
47+
downlink::{DownlinkOptions, DownlinkRuntimeConfig},
4848
};
4949
use swimos_utilities::{
5050
byte_channel::{are_connected, ByteReader, ByteWriter},
@@ -56,7 +56,7 @@ use uuid::Uuid;
5656

5757
use crate::server::runtime::{ClientRegistration, EstablishedClient, NewClientError};
5858

59-
use super::{downlink_task_connector, DlTaskRequest, DownlinkConnectionTask, ServerConnector};
59+
use super::{downlink_task_connector, DlTaskRequest, DownlinkConnectionTask, Io, ServerConnector};
6060

6161
struct TestContext {
6262
connector: ServerConnector,

server/swimos_server_app/src/server/runtime/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ use swimos_runtime::agent::{
4343
AgentAttachmentRequest, AgentExecError, AgentRouteDescriptor, AgentRouteChannels, AgentRouteTask,
4444
CombinedAgentConfig, DisconnectionReason, LinkRequest,
4545
};
46-
use swimos_runtime::downlink::Io;
4746
use swimos_utilities::routing::RouteUri;
4847

4948
use swimos_remote::websocket::{RatchetError, Websockets};
@@ -61,6 +60,7 @@ use crate::config::SwimServerConfig;
6160
use crate::plane::PlaneModel;
6261
use crate::server::runtime::downlinks::DlTaskRequest;
6362
use crate::server::ServerHandle;
63+
use crate::Io;
6464

6565
use self::downlinks::{DownlinkConnectionTask, ServerConnector};
6666
use self::ids::{IdIssuer, IdKind};

0 commit comments

Comments
 (0)