Skip to main content

Crate hydro2

Crate hydro2 

Source

Modules§

async_trait
githubcrates-iodocs-rs
unsafe_erased

Macros§

edge
network
node
task_item
test_wire_port0_into
test_wire_port1_into
test_wire_port2_into
test_wire_port3_into
try_build_async_scheduler_config
A macro to build an AsyncSchedulerConfig without using .unwrap() or .expect(). It returns a Result<AsyncSchedulerConfig, NetworkError> so you can use ?.

Structs§

AddOp
AsyncScheduler
AsyncSchedulerBuilder
Builder for AsyncScheduler.
AsyncSchedulerConfig
Configuration for our upgraded asynchronous scheduler.
AsyncSchedulerConfigBuilder
Builder for AsyncSchedulerConfig.
ConstantOp
DoubleOutOp
DoubleToTriOp
DoubleToTriTwoGenericsOp
FailingOperator
InFlightCounter
Tracks the in-flight tasks: how many nodes are actively being processed by workers.
IncrementOperator
Merge2Op
MockCheckpointCallback
A mock checkpoint callback that records each checkpoint invocation.
MockCheckpointCallbackBuilder
Builder for MockCheckpointCallback.
MultiplyOp
Network
The full network containing nodes, edges, and any relevant metadata.
NetworkBuilder
Builder for Network.
NetworkEdge
Represents an edge in the DAG, connecting one node’s output to another node’s input.
NetworkEdgeBuilder
Builder for NetworkEdge.
NetworkNode
Represents a single node in the network. Each node has an associated operator and references to its input and output buffers.
NetworkNodeBuilder
Builder for NetworkNode.
NoOpCheckpointCallback
NoOpOperator
PerformanceStats
Tracks performance statistics for network execution.
QuadToQuadOp
SharedCompletedNodes
A concurrency‐safe set of completed node indices, using tokio::sync::AsyncMutex<HashSet<usize>>.
SingleChannelPassthroughOperator
SingleToTriOp
SingleValOp
SinkOperator
SplitAndDoubleOp
StreamyOperator
TaskItem
Each node execution is one TaskItem.
TaskItemBuilder
Builder for TaskItem.
TaskResult
The result we get back from a worker.
TaskResultBuilder
Builder for TaskResult.
TestWire
TriToQuadOp
TriToSingleOp
WorkerPool
A pool of OS threads:
WorkerPoolBuilder
Builder for WorkerPool.

Enums§

AddOpIO
AsyncSchedulerBuilderError
Error type for AsyncSchedulerBuilder
AsyncSchedulerConfigBuilderError
Error type for AsyncSchedulerConfigBuilder
BasicOpCode
High-level codes for each stage/operator in the pipeline.
BatchingStrategy
A simple enum to govern how nodes are scheduled:
ConstantOpIO
DoubleOutOpIO
DoubleToTriOpIO
DoubleToTriTwoGenericsOpIO
FailingOperatorIO
FreedChildReceivedOperationOutcome
IncrementOperatorIO
InsertOutcome
Outcome when inserting a node index into SharedCompletedNodes.
Merge2OpIO
MockCheckpointCallbackBuilderError
Error type for MockCheckpointCallbackBuilder
MultiplyOpIO
NetworkBuilderError
Error type for NetworkBuilder
NetworkEdgeBuilderError
Error type for NetworkEdgeBuilder
NetworkError
NetworkNodeBuilderError
Error type for NetworkNodeBuilder
NoOpOperatorIO
OperatorFailureReason
QuadToQuadOpIO
ReadyNodeReceivedOperationOutcome
SingleChannelPassthroughOperatorIO
SingleToTriOpIO
SingleValOpIO
SinkOperatorIO
SplitAndDoubleOpIO
StreamyOperatorIO
TaskItemBuilderError
Error type for TaskItemBuilder
TaskResultBuilderError
Error type for TaskResultBuilder
TestWireIO
TriToQuadOpIO
TriToSingleOpIO
WorkerPoolBuilderError
Error type for WorkerPoolBuilder

Traits§

CheckpointCallback
A trait invoked periodically to record checkpoint data. This can write partial progress to disk, a DB, etc.
IntoArcOperator
A local trait to convert any T that implements Operator into Arc<dyn Operator>.
OpCode
Operator
A trait that describes a single operator within the network. Each operator is responsible for processing input buffers to produce output buffers.
OperatorSignature
The trait describing up to 4 inputs and 4 outputs for an operator. Each #[derive(Operator)] implementation will provide a hidden struct implementing these 8 associated types.
PortTryFrom0
The dual trait: from a source type Src into Self, given port 0.
PortTryFrom1
The dual trait: from a source type Src into Self, given port 0.
PortTryFrom2
The dual trait: from a source type Src into Self, given port 0.
PortTryFrom3
The dual trait: from a source type Src into Self, given port 0.
PortTryInto0
A local trait for “port-aware” conversions
PortTryInto0Any
PortTryInto1
A local trait for “port-aware” conversions
PortTryInto2
A local trait for “port-aware” conversions
PortTryInto3
A local trait for “port-aware” conversions
PortTryInto1Any
PortTryInto2Any
PortTryInto3Any

Functions§

aggregator_thread_behavior
Aggregator thread that reads incoming TaskItems, distributing them to workers. We now log each phase of the aggregator’s loop in more detail, which can reveal if aggregator is stuck waiting for input or if workers are closed prematurely.
build_and_send_task_result
Builds and sends a TaskResult to the aggregator (or whomever is listening). Added logs detail the error state and the exact moment we send the result.
check_all_nodes_done
Utility function for your scheduling loop, logging the “done_count”.
clear_checkpoint_invocations
Clears the global list, so each test can start fresh.
compute_freed_children
create_worker_channels
current_memory_usage_in_bytes
drain_channel
Drains a Receiver<usize> until None, returning items read.
execute_node
Executes the specified node (node_idx) from net_guard, optionally sends streaming output (if output_tx is Some(...)), and decrements in-degs to compute Freed children. Returns (freed_children, error).
fetch_next_task
Retrieves the next TaskItem from the worker’s channel. We now log more details about whether we’re waiting, whether a task is present, etc. This can help confirm if a worker is truly idle or if a hang might be from unreceived tasks.
get_mock_checkpoint_invocations
Returns the global list of checkpointed nodes, for assertion in tests.
handle_freed_children
Sends Freed children to ready_nodes_tx. This step can be a source of hangs if the channel is at capacity or closed. We add logs at each step to ensure we see exactly where Freed children get queued.
mock_failing_operator_task
Creates a TaskItem that uses a FailingOperator at node_idx. The reason is used for the failing operator’s error message.
mock_permit
mock_task_with_checkpoint
poll_worker_results
process_immediate
process_immediate_freed_child_received
process_immediate_ready_node_received
process_task
Processes the task by locking the network, executing the node operator, and computing Freed children. More detailed logs to help ensure we see exact timing and concurrency behavior.
process_waves
A wave-based scheduling function that:
read_next_wave
Reads the first node from ready_nodes_rx, then drains from child_nodes_rx and ready_nodes_rx.
release_concurrency
Releases any concurrency permit if present. This step is crucial in preventing a hang if a worker forgets to release. Added explicit logs to confirm the permit is dropped.
spawn_aggregator
spawn_aggregator_and_workers
Spawns an aggregator plus N worker threads, returning a Vec of handles.
spawn_worker_thread
Spawns one worker OS thread within the given scope. The worker runs a mini tokio runtime that calls worker_main_loop. Returns a ScopedJoinHandle you can store or join later.
submit_chunk_to_worker_pool
Submits each node in chunk to the worker pool, attempting to acquire a concurrency permit. We now log every step more carefully to aid in debugging concurrency/hangs.
validate_network
Validates the network by locking it and invoking validate(). Returns an error if validation fails.
wait_until_all_tasks_in_chunk_are_done
Wait until all tasks in chunk are done. We do a select! with worker results first, Freed children second, and a small sleep if neither are ready.
wire_up_network
Wires up all outputs and inputs across the network, checking port‐range, type‐string compatibility, required‐connection fulfillment, and fan‐in/fan‐out rules. Returns an error if any violation occurs.
worker_main_loop
A worker’s main loop: continuously fetch tasks, process them, and send results. We’ve added extra logs at each stage. If a deadlock or hang occurs, these logs can help identify if the channel is closed, concurrency is blocked, etc.

Type Aliases§

MockCheckpointType
NetResult
A convenient result alias for network operations.
NetworkNodeIoChannelArray
NetworkNodeIoChannelReadGuardArray
NetworkNodeIoChannelValues
NetworkNodeIoChannelWriteGuardArray
StreamingOutput
Optional streaming outputs from each operator:
StreamingOutputSender

Derive Macros§

NetworkWire
Operator
The main entry point for [derive(Operator)].