Component design question

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Component design question

Stephen J
I would like to modify a component to not process messages until it has a client connected to it's endpoint. How would I go about preventing it from consuming messages from the source until it detects that a client has attached to it's endpoint?

Here's a diagram to illustrate my wish.

no clients connected to endpoint...

| from(x) |----------XX----------------| to(y) |---( no clients attached )
                no messages passed

client connects to endpoint...

| from(x) |-----------------------------| to(y) |---| client attached |
                    messages are passed

Please let me know if there would be better ways to do this. I've thought about an event driven delayer that would receive signals from the component or something. Perhaps the solution could be constructed to be available to more than just the component I am using.