Skip to content

Commit

Permalink
refactor(hydroflow_plus)!: further reduce namespace pollution
Browse files Browse the repository at this point in the history
Some re-exports are only useful for the macro-based API, which is deprecated in favor of trybuild anyways.
  • Loading branch information
shadaj committed Nov 28, 2024
1 parent 6688e97 commit 30d68e5
Show file tree
Hide file tree
Showing 16 changed files with 21 additions and 16 deletions.
2 changes: 1 addition & 1 deletion hydroflow_plus/src/deploy/trybuild.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ pub fn compile_graph_trybuild(graph: HydroflowGraph, extra_stmts: Vec<syn::Stmt>
use hydroflow_plus::*;

#[allow(unused)]
fn __hfplus_runtime<'a>(__hydroflow_plus_trybuild_cli: &'a hydroflow_plus::hydroflow::util::deploy::DeployPorts<hydroflow_plus::deploy::HydroflowPlusMeta>) -> hydroflow_plus::Hydroflow<'a> {
fn __hfplus_runtime<'a>(__hydroflow_plus_trybuild_cli: &'a hydroflow_plus::hydroflow::util::deploy::DeployPorts<hydroflow_plus::deploy::HydroflowPlusMeta>) -> hydroflow_plus::hydroflow::scheduled::graph::Hydroflow<'a> {
#(#extra_stmts)*
#tokens
}
Expand Down
8 changes: 4 additions & 4 deletions hydroflow_plus/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
stageleft::stageleft_no_entry_crate!();

pub use hydroflow;
pub use hydroflow::scheduled::graph::Hydroflow;
pub use stageleft::*;
pub use stageleft::q;

#[doc(hidden)]
pub mod runtime_support {
pub use bincode;
}
Expand All @@ -17,7 +17,7 @@ pub mod boundedness;
pub use boundedness::{Bounded, Unbounded};

pub mod stream;
pub use stream::Stream;
pub use stream::{NoOrder, Stream, TotalOrder};

pub mod singleton;
pub use singleton::Singleton;
Expand All @@ -27,7 +27,7 @@ pub use optional::Optional;

pub mod location;
pub use location::cluster::CLUSTER_SELF_ID;
pub use location::{Cluster, ClusterId, Location, Process, Tick};
pub use location::{Cluster, ClusterId, ExternalProcess, Location, Process, Tick, Timestamped};

pub mod deploy;

Expand Down
2 changes: 1 addition & 1 deletion hydroflow_plus/src/location/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pub mod can_send;
pub use can_send::CanSend;

pub mod tick;
pub use tick::{NoTick, Tick};
pub use tick::{NoTick, Tick, Timestamped};

#[derive(PartialEq, Eq, Clone, Debug)]
pub enum LocationId {
Expand Down
2 changes: 0 additions & 2 deletions hydroflow_plus_test/src/cluster/paxos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ use std::hash::Hash;
use std::time::Duration;

use hydroflow_plus::*;
use location::tick::Timestamped;
use serde::de::DeserializeOwned;
use serde::{Deserialize, Serialize};
use stream::NoOrder;

use super::quorum::{collect_quorum, collect_quorum_with_response};
use super::request_response::join_responses;
Expand Down
1 change: 0 additions & 1 deletion hydroflow_plus_test/src/cluster/paxos_bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ use std::rc::Rc;
use std::time::Duration;

use hydroflow_plus::*;
use stream::{NoOrder, TotalOrder};
use tokio::time::Instant;

use super::paxos::{Acceptor, Ballot, Proposer};
Expand Down
1 change: 0 additions & 1 deletion hydroflow_plus_test/src/cluster/paxos_kv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ use std::hash::Hash;
use hydroflow_plus::*;
use serde::de::DeserializeOwned;
use serde::{Deserialize, Serialize};
use stream::NoOrder;

use super::paxos::{paxos_core, Acceptor, Ballot, Proposer};

Expand Down
1 change: 0 additions & 1 deletion hydroflow_plus_test/src/cluster/quorum.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use std::hash::Hash;

use hydroflow_plus::*;
use location::tick::Timestamped;
use location::NoTick;

#[expect(clippy::type_complexity, reason = "internal paxos code // TODO")]
Expand Down
2 changes: 0 additions & 2 deletions hydroflow_plus_test/src/cluster/request_response.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
use std::hash::Hash;

use hydroflow_plus::*;
use location::tick::Timestamped;
use location::NoTick;
use stream::NoOrder;

type JoinResponses<K, M, V, L> = Stream<(K, (M, V)), Timestamped<L>, Unbounded, NoOrder>;

Expand Down
1 change: 0 additions & 1 deletion hydroflow_plus_test/src/distributed/first_ten.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use hydroflow_plus::*;
use location::external_process::ExternalBincodeSink;
use location::ExternalProcess;
use serde::{Deserialize, Serialize};

#[derive(Serialize, Deserialize)]
Expand Down
2 changes: 2 additions & 0 deletions hydroflow_plus_test_local/src/local/chat_app.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
use hydroflow::tokio::sync::mpsc::UnboundedSender;
use hydroflow::tokio_stream::wrappers::UnboundedReceiverStream;
use hydroflow_plus::deploy::SingleProcessGraph;
use hydroflow_plus::hydroflow::scheduled::graph::Hydroflow;
use hydroflow_plus::*;
use stageleft::{Quoted, RuntimeData};

#[stageleft::entry]
pub fn chat_app<'a>(
Expand Down
2 changes: 2 additions & 0 deletions hydroflow_plus_test_local/src/local/compute_pi.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
use std::time::Duration;

use hydroflow_plus::deploy::SingleProcessGraph;
use hydroflow_plus::hydroflow::scheduled::graph::Hydroflow;
use hydroflow_plus::*;
use stageleft::{Quoted, RuntimeData};

pub fn compute_pi<'a>(flow: &FlowBuilder<'a>, batch_size: RuntimeData<usize>) -> Process<'a, ()> {
let process = flow.process();
Expand Down
4 changes: 3 additions & 1 deletion hydroflow_plus_test_local/src/local/count_elems.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
use hydroflow::tokio::sync::mpsc::UnboundedSender;
use hydroflow::tokio_stream::wrappers::UnboundedReceiverStream;
use hydroflow_plus::deploy::SingleProcessGraph;
use hydroflow_plus::hydroflow::scheduled::graph::Hydroflow;
use hydroflow_plus::*;
use stageleft::{Quoted, RuntimeData};

pub fn count_elems_generic<'a, T: 'a>(
flow: FlowBuilder<'a>,
input_stream: RuntimeData<UnboundedReceiverStream<T>>,
output: RuntimeData<&'a UnboundedSender<u32>>,
) -> impl QuotedWithContext<'a, Hydroflow<'a>, ()> {
) -> impl Quoted<'a, Hydroflow<'a>> {
let process = flow.process::<()>();
let tick = process.tick();

Expand Down
2 changes: 2 additions & 0 deletions hydroflow_plus_test_local/src/local/first_ten.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
use hydroflow_plus::deploy::SingleProcessGraph;
use hydroflow_plus::hydroflow::scheduled::graph::Hydroflow;
use hydroflow_plus::*;
use stageleft::Quoted;

pub fn first_ten(flow: &FlowBuilder) {
let process = flow.process::<()>();
Expand Down
3 changes: 2 additions & 1 deletion hydroflow_plus_test_local/src/local/graph_reachability.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
use hydroflow::tokio::sync::mpsc::UnboundedSender;
use hydroflow::tokio_stream::wrappers::UnboundedReceiverStream;
use hydroflow_plus::deploy::SingleProcessGraph;
use hydroflow_plus::hydroflow::scheduled::graph::Hydroflow;
use hydroflow_plus::*;
use stream::NoOrder;
use stageleft::{Quoted, RuntimeData};

#[stageleft::entry]
pub fn graph_reachability<'a>(
Expand Down
2 changes: 2 additions & 0 deletions hydroflow_plus_test_local/src/local/negation.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
use hydroflow::tokio::sync::mpsc::UnboundedSender;
use hydroflow_plus::deploy::SingleProcessGraph;
use hydroflow_plus::hydroflow::scheduled::graph::Hydroflow;
use hydroflow_plus::*;
use stageleft::{Quoted, RuntimeData};

#[stageleft::entry]
pub fn test_difference<'a>(
Expand Down
2 changes: 2 additions & 0 deletions hydroflow_plus_test_local/src/local/teed_join.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ use hydroflow::futures::stream::Stream;
use hydroflow::tokio::sync::mpsc::UnboundedSender;
use hydroflow::tokio_stream::wrappers::UnboundedReceiverStream;
use hydroflow_plus::deploy::MultiGraph;
use hydroflow_plus::hydroflow::scheduled::graph::Hydroflow;
use hydroflow_plus::*;
use stageleft::{Quoted, RuntimeData};

struct N0 {}
struct N1 {}
Expand Down

0 comments on commit 30d68e5

Please sign in to comment.