Skip to content

Commit eecd836

Browse files
committed
[external feedback] it is more common to change store than params, flipping order
1 parent 638f15d commit eecd836

5 files changed

Lines changed: 78 additions & 112 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ struct RequestCtx {
271271

272272
// Nodes can access and modify the custom store directly
273273
#[async_trait]
274-
impl Node<ProcessingState, (), RequestCtx> for MetricsNode {
274+
impl Node<ProcessingState, RequestCtx> for MetricsNode {
275275
async fn prep(&self, store: &RequestCtx) -> Result<String, CanoError> {
276276
// Direct field access - no hash map lookups
277277
Ok(store.request_body.clone())

examples/workflow_stack_store.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ enum ProcessingState {
122122
struct MetricsNode;
123123

124124
#[async_trait]
125-
impl Node<ProcessingState, DefaultParams, RequestCtx> for MetricsNode {
125+
impl Node<ProcessingState, RequestCtx> for MetricsNode {
126126
type PrepResult = String;
127127
type ExecResult = (f64, String, u32);
128128

@@ -180,7 +180,7 @@ impl Node<ProcessingState, DefaultParams, RequestCtx> for MetricsNode {
180180
struct ResponseNode;
181181

182182
#[async_trait]
183-
impl Node<ProcessingState, DefaultParams, RequestCtx> for ResponseNode {
183+
impl Node<ProcessingState, RequestCtx> for ResponseNode {
184184
type PrepResult = (f64, String, u32);
185185
type ExecResult = (String, u16);
186186

@@ -280,7 +280,7 @@ async fn main() -> CanoResult<()> {
280280
println!("Demonstrating custom store types for node communication\n");
281281

282282
// Create the processing workflow
283-
let mut workflow: Workflow<ProcessingState, DefaultParams, RequestCtx> =
283+
let mut workflow: Workflow<ProcessingState, RequestCtx> =
284284
Workflow::new(ProcessingState::IncomingRequest);
285285

286286
workflow

src/node.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ impl NodeConfig {
280280
/// }
281281
/// ```
282282
#[async_trait]
283-
pub trait Node<TState, TParams = DefaultParams, TStore = MemoryStore>: Send + Sync
283+
pub trait Node<TState, TStore = MemoryStore, TParams = DefaultParams>: Send + Sync
284284
where
285285
TState: Clone + std::fmt::Debug + Send + Sync + 'static,
286286
TParams: Send + Sync + Clone,
@@ -888,7 +888,7 @@ mod tests {
888888
// Test specific trait bounds instead of full trait object
889889
fn assert_node_traits<N>(_: &N)
890890
where
891-
N: Node<TestAction, DefaultParams, MemoryStore, PrepResult = String, ExecResult = bool>,
891+
N: Node<TestAction, MemoryStore, DefaultParams, PrepResult = String, ExecResult = bool>,
892892
{
893893
}
894894

0 commit comments

Comments
 (0)