MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / create_and_publish

Function create_and_publish

nodedb/src/control/pubsub.rs:362–376  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

360
361 #[test]
362 fn create_and_publish() {
363 let registry = TopicRegistry::new(1000);
364 assert!(registry.create_topic("orders").is_ok());
365 assert!(registry.create_topic("orders").is_err()); // duplicate
366
367 let (seq, _receivers) = registry
368 .publish("orders", "order-1".into(), "admin")
369 .unwrap();
370 assert_eq!(seq, 1);
371
372 let (seq, _receivers) = registry
373 .publish("orders", "order-2".into(), "admin")
374 .unwrap();
375 assert_eq!(seq, 2);
376 }
377
378 #[test]
379 fn subscribe_with_backlog() {

Callers

nothing calls this directly

Calls 1

publishMethod · 0.45

Tested by

no test coverage detected