Add and test TryMakeFetcher, TryMakeSender, and NodeHasTag helpers
Using a Fetcher for a channel on nodes where it exists and triggering
logic to handle other nodes based on whether the fetcher is valid works
well for some use cases. Add a method to EventLoop to support that
directly, instead of forcing the caller to redo the logic around whether
a channel exists and is readable. Basing similar logic off whether the
node has a given tag is also fairly common.
In the process, fill out the EventLoop tests around channels that don't
exist or aren't readable/writable a bit better.
Change-Id: I168e3c1e98adc4461a01d98360f0f0a78d24bbb5
Signed-off-by: Brian Silverman <brian.silverman@bluerivertech.com>
diff --git a/aos/events/event_loop_param_test.h b/aos/events/event_loop_param_test.h
index 543bb21..a9d280e 100644
--- a/aos/events/event_loop_param_test.h
+++ b/aos/events/event_loop_param_test.h
@@ -225,6 +225,21 @@
"name": "/test2",
"type": "aos.TestMessage",
"source_node": "me"
+ },
+ {
+ "name": "/test_forward",
+ "type": "aos.TestMessage",
+ "source_node": "them",
+ "destination_nodes": [
+ {
+ "name": "me"
+ }
+ ]
+ },
+ {
+ "name": "/test_noforward",
+ "type": "aos.TestMessage",
+ "source_node": "them"
}
],
"nodes": [