mirror of
https://github.com/elicpeter/nyx.git
synced 2026-06-21 20:18:06 +02:00
**refactor(dynamic): introduce NATS protocol emulator with publish/deliver support, enhance endpoint handling, and extend SDK compatibility for Go and Python**
This commit is contained in:
parent
a55849f1ca
commit
a12f7efc3a
7 changed files with 527 additions and 28 deletions
|
|
@ -395,6 +395,27 @@ fn message_handler_remaining_brokers_try_http_emulators_before_loopback() {
|
|||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn message_handler_nats_go_tries_real_client_before_fallbacks() {
|
||||
let spec = make_spec_with_adapter(
|
||||
Lang::Go,
|
||||
"events",
|
||||
"OnMessage",
|
||||
entry_file("nats_go"),
|
||||
"nats-go",
|
||||
);
|
||||
let h = lang::emit(&spec).expect("emit ok");
|
||||
assert!(h.source.contains("nyxTryRealNats"));
|
||||
assert!(h.source.contains("github.com/nats-io/nats.go"));
|
||||
assert!(h.source.contains("nats.Connect"));
|
||||
assert!(h.source.contains("nc.Subscribe"));
|
||||
assert!(h.source.contains("nc.Publish"));
|
||||
assert!(
|
||||
h.source.find("nyxTryRealNats").unwrap() < h.source.find("nyxFetchHttpBroker").unwrap(),
|
||||
"nats-go should try the real protocol client before the HTTP fallback"
|
||||
);
|
||||
}
|
||||
|
||||
// ── Framework-adapter assertions ──────────────────────────────────────────────
|
||||
|
||||
fn ts_language_for(lang: Lang) -> tree_sitter::Language {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue