Perhaps you can simplify the problem and avoid runtime evaluation of ASTs. Instead of publishing a “pattern AST” to the
Hub, you can probably call a macro in the subscriber which:
receive, matching against the pattern you want.
In other words, you would send messages to all subscribers and they would decide whether they want it or not.
Here’s some example code: