Skip to content

feat: destroy stream in CRE flow#167

Merged
MicBun merged 1 commit intomainfrom
destroyStreamTransport
Dec 24, 2025
Merged

feat: destroy stream in CRE flow#167
MicBun merged 1 commit intomainfrom
destroyStreamTransport

Conversation

@MicBun
Copy link
Copy Markdown
Member

@MicBun MicBun commented Dec 24, 2025

resolves: https://github.com/truflation/website/issues/3055

Summary by CodeRabbit

  • Refactor
    • Enhanced transport layer architecture to support multiple transport mechanisms for stream operations, enabling improved system flexibility and integration options.

✏️ Tip: You can customize this high-level summary in your review settings.

@MicBun MicBun self-assigned this Dec 24, 2025
@MicBun MicBun added the enhancement New feature or request label Dec 24, 2025
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Dec 24, 2025

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

This change introduces transport-type branching within the TN client to support multiple transport implementations. Methods like DestroyStream, DeployStream, LoadActions, and LoadPrimitiveActions now conditionally route to HTTP gateway APIs or execute direct transport operations based on the configured transport type.

Changes

Cohort / File(s) Summary
Core Client Transport Routing
core/tnclient/client.go
Modified DestroyStream to route HTTPTransport requests to the HTTP gateway API and non-HTTP transports to execute delete_stream directly via the transport with signer-derived address. Modified DeployStream to route HTTPTransport to existing path and non-HTTP transports to execute create_stream with streamId and streamType. Modified LoadActions and LoadPrimitiveActions to return HTTP gateway-backed implementations for HTTPTransport and transport-aware wrapper implementations (TransportAction/TransportPrimitiveAction) for non-HTTP transports.

Sequence Diagram

sequenceDiagram
    participant Client
    participant TNClient
    participant Transport
    
    rect rgb(200, 220, 240)
    Note over Client,Transport: Stream Management Request
    Client->>TNClient: DeployStream/DestroyStream
    alt HTTPTransport
        TNClient->>Transport: Route to HTTP gateway API
        Transport->>Transport: Execute via KwilClient
    else Non-HTTP Transport
        TNClient->>Transport: Execute direct create_stream/delete_stream
        Transport->>Transport: Derive address from signer
        Transport->>Transport: Execute operation
    end
    Transport-->>TNClient: Result
    TNClient-->>Client: Response
    end
    
    rect rgb(240, 220, 200)
    Note over Client,Transport: Action Loading Request
    Client->>TNClient: LoadActions/LoadPrimitiveActions
    alt HTTPTransport
        TNClient->>Transport: Return GatewayClient implementation
    else Non-HTTP Transport
        TNClient->>Transport: Return Transport-aware wrapper
    end
    Transport-->>TNClient: Action implementation
    TNClient-->>Client: Actions
    end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 Hops with delight

Transport paths now split in two,
HTTP here, direct there too,
One client serves with clever grace,
Each transport finds its rightful place!
The roads diverge, yet both lead home. 🛤️

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch destroyStreamTransport

📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 853c26d and e366893.

📒 Files selected for processing (1)
  • core/tnclient/client.go

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@holdex
Copy link
Copy Markdown

holdex bot commented Dec 24, 2025

Time Submission Status

Member Status Time Action Last Update
MicBun ✅ Submitted 2h Update time Dec 24, 2025, 11:45 AM

@MicBun MicBun force-pushed the destroyStreamTransport branch from f0a7d9f to a489620 Compare December 24, 2025 11:44
@MicBun MicBun force-pushed the destroyStreamTransport branch from a489620 to e366893 Compare December 24, 2025 11:45
@MicBun MicBun merged commit dc627bd into main Dec 24, 2025
3 checks passed
@MicBun MicBun deleted the destroyStreamTransport branch December 24, 2025 11:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant