Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ comline-core = { git = "https://github.com/ComlineProject/core", rev = "47ac5f10
# `generation` tip (only `conformance/`, which this crate never touches,
# differs), so matching it here keeps one `comline-codegen` in the tree.
comline-codegen = { git = "https://github.com/ComlineProject/generation", rev = "1f8c5e290eba72a578860ebb6dc33453a2f0726b" }
comline-codegen-rust = { git = "https://github.com/ComlineProject/comline-rust", rev = "1191e76068eca75ea7c4148d58ab127bb005e81a", optional = true }
comline-codegen-rust = { git = "https://github.com/ComlineProject/comline-rust", rev = "a0ade3bceeb51876be7565601b3b9c9c3d807196", optional = true }
comline-codegen-typescript = { git = "https://github.com/ComlineProject/comline-typescript", rev = "86fc4eb586529ef92041f8dd3c46ff9340103411", optional = true }

[features]
Expand Down
11 changes: 6 additions & 5 deletions tests/cli/end_to_end.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@ use std::sync::{Arc, Mutex};
use std::thread;

use chat_e2e::chat::{Chat, ChatClient, ChatDispatcher, ChatSendError, Message, Rejected};
use comline_runtime::client::Client;
use comline_runtime::contract::CallError;
use comline_runtime::format::MsgPack;
use comline_runtime::serve::Server;
use comline_runtime::transport::duplex;

struct Svc {
Expand All @@ -46,14 +44,17 @@ fn client_and_provider_over_duplex() {
let notes = Arc::new(Mutex::new(Vec::new()));
let notes_for_svc = notes.clone();

// Provider: the generated `serve` helper runs the connection handshake
// (IR_HASH + format name) before serving.
let provider = thread::spawn(move || {
let mut provider_side = provider_side;
Server::new(ChatDispatcher(Svc { notes: notes_for_svc }), MsgPack)
.serve(&mut provider_side)
ChatDispatcher(Svc { notes: notes_for_svc })
.serve(&mut provider_side, MsgPack)
.unwrap();
});

let mut client = ChatClient::new(Client::new(client_side, MsgPack));
// Client: the generated `connect` helper does the matching handshake.
let mut client = ChatClient::connect(client_side, MsgPack).expect("handshake");

assert_eq!(client.send("hi").unwrap().body, "echo: hi");

Expand Down
Loading