On Wed, Jun 24, 2015 at 11:47 AM, Rob Miller <[email protected]> wrote:

> On 06/24/2015 11:41 AM, David Birdsong wrote:
>
>> On Wed, Jun 24, 2015 at 11:37 AM Rob Miller <[email protected]
>> <mailto:[email protected]>> wrote:
>>
>>     There's nothing preventing Heka from growing the ability to
>>     dynamically add output plugins to the router. I'm not sure that's
>>     the right approach, though. Doing what you want means that you'd
>>     have one output plugin listening for connections, which would then
>>     be responsible for adding and removing additional output plugins to
>>     the router and managing their lifecycles, etc. It's possible, it's
>>     similar to what the SandboxManagerFilter does, but I think it
>>     introduces more complexity than is necessary.
>>
>>     Instead, I'd recommend doing everything you need inside the code for
>>     a single output plugin. If you set that output plugin up with
>>     `message_matcher = "TRUE"`, then every message will be delivered to
>>     the output. Inside the output code you can basically implement your
>>     own mini-router, which would instantiate message matchers and
>>     deliver matches out over the connections that registered them.
>>
>>     -r
>>
>>
>> yeah, this is what i was concocting yesterday after browsing godoc. just
>> run my own MatchRunner instance inside a websocket enabled output plugin.
>>
> Exactly. You'd actually probably have a slice of MatchRunners.
>
>> i'm sure i'm glossing over some complexities and it wouldn't be the
>> easiest output plugin to write, but since all the necessary interfaces
>> and types are public and pluggable, it's conceivable, right?
>>
> Absolutely. It's not even all that tough, IMO. Main thing is to manage the
> race conditions. You need to guard the slice of MatchRunners, probably w/ a
> RWMutex, and use the write lock whenever you're adding or removing
> connections to or from the existing set, use the read lock when you're
> accessing them. It's a bit of work, but it's much less complicated than
> what you were describing originally.
>
> I'd be happy to include such a plugin in the Heka core, although I'm
> guessing that you'll probably write it to the older API first, since I know
> you're not tracking the bleeding edge. Ah well, nothing to be done...
>
> -r
>
>
whoops, new google inbox defaults to not reply-all.

i'm not sure when i'd start on this since i today brings fire drills that
dictate the next few days, but i would rather invest the time to try out
the new api.
_______________________________________________
Heka mailing list
[email protected]
https://mail.mozilla.org/listinfo/heka

Reply via email to