[muscle] Re: pattern for subscribe messages

  • From: "Jeremy Friesner" <jaf@xxxxxxxxxxxx>
  • To: muscle@xxxxxxxxxxxxx
  • Date: Sat, 26 Jun 2004 21:30:15 PDT (-0700)

Hi Wilson,

> When I send a subscribe message with subscription pattern * (star), I 
> get messages that match only the top level.  Right now, I need to do:
> 
>       *
>       */*
>       */*/*
>       */*/*/* 
> etc.
> 
> How can I say "all messages with any pattern"=3F

Unfortunately, there is no built-in better way to do that than the way you
are doing it now.  MUSCLE queries don't have a syntax that can specify
database nodes of arbitrary depth.  If you do need to keep track of nodes
of arbitrarily deep nesting, here are some possible ways to work around
that limitation:

1) Have each client that is uploading data to the database also upload
a node containing information about how deep the data goes.  The other
clients could subscribe to this node, and update their own subscription strings
appropriately whenever its contents indicate that the maximum node
depth has changed.

2) Customize your muscle server to allow for some sort of special
syntax or pattern that would support what you want to do.
 
> Also, what if I want to say:
> 
>       */*/xyz/*
> 
> without having to specify:
> 
>       */*/xyz/*
>       */*/xyz/*/*
>       */*/xyz/*/*/*
> 
> etc.
> 
> Will I need to modify the server=3F

Yeah, I think you would have to.  If you don't absolutely need
an arbitrary deep nesting of nodes, I'd recommend just specifying
a maximum supported node depth, and then all the clients can just post
a finite set of query strings as in your example above.

Jeremy



Other related posts: