Forums > Dev

Binding functions to symbol messages to second inlet only?

June 21, 2007 | 1:13 am

I want an object with two inlets.

I want the first inlet to be able to accept any message.

I want to bind functions to the second inlet, accepting several specific messages (symbol messagename, symbol argument), and reject any others. Rejected messages should not be passed to the first inlet.

The first inlet should also be able to accept the same specific messages, but pass them through, not executing the bound function.

Given the above, is it possible to avoid testing the inlet number every time a message arrives at an inlet – especially for the first inlet?

What’s the best way to deal with this sort of thing?


June 21, 2007 | 9:02 am

Let me ask you a question: why don’t you want to test? If you have to
use the words "clean" or "efficient" or "optimize" in your answer,
you are likely spending your time chasing a spectre.

Your bottleneck, if it exists, is not, and will never be, an if or
switch testing the origin of messages as they arrive.

jb

Am 21.06.2007 um 03:13 schrieb John Pitcairn:

> Given the above, is it possible to avoid testing the inlet number
> every time a message arrives at an inlet – especially for the first
> inlet?


June 21, 2007 | 8:48 pm

Yeah, fair enough. I was just interested to know if there was an alternate way to do this sort of thing. The docs imply that there isn’t, but that may just be my mis-reading.


Viewing 3 posts - 1 through 3 (of 3 total)