femebe icon indicating copy to clipboard operation
femebe copied to clipboard

Elegant API for common use cases

Open msakrejda opened this issue 12 years ago • 1 comments

Two use cases that FEMEBE should support out-of-the box are proxies for both "Spy mode" and "Maxwell's Demon mode". In both modes, FEMEBE should allow routing based on contents of the Startup message.

In Spy mode, the user would have a struct per-connection that would get a callback for every message flowing on the stream. The connection itself would continue as normal, with no way for the user to affect it.

In Demon mode, the user would also get callbacks per-message, but would have the additional responsibility of routing the messages (including skipping or modifying existing messages, or inserting new ones).

The current two half-duplex channel idea is very general and simple, but it will scale poorly to real applications (in terms of code complexity), since most proxies will have to repeat the same general scaffolding.

msakrejda avatar Dec 28 '12 18:12 msakrejda

Given some of our use cases in routing software, it'd be nice to start as the demon and end as the spy.

fdr avatar Dec 29 '12 04:12 fdr