[Twisted-Python] Endpoint composition syntax

Kevin Conway kevinjacobconway at gmail.com
Thu Oct 13 05:14:27 MDT 2016


> we can just look up until the first ':'; we just need to define a new
interface for a new syntax.

What do you think of adding a special argument for endpoint strings called
"wraps" or "pipe" that tells the parser to recombine the right-hand side
and send it back through the parser? For example:

 haproxy:*pipe=*
ssl:port=443:privateKey=/etc/ssl/server.pem:extraCertChain=/etc/ssl/chain.pem:sslmethod=SSLv3_METHOD:dhParameters=dh_param_1024.pem:
*pipe=*tcp:7.6.5.4:443:*pipe=*unix:path=/var/run/web.sock

I believe this would fit as a backwards compatible change to the syntax and
would also position us to add composition support to the existing endpoints
in backwards compatible ways. As endpoints gain composition support,
existing users can opt-in by adding the new argument to existing string
descriptors.

This topic coming back up is timely for me. I was recently talking with a
user of the haproxy endpoint wrapper who was hitting an issue with the SSL
endpoint not playing well when used in composition. I'll spin off another
thread for that topic, but coming up with a syntax for composition is going
to be pre-requisite to having true composition support.

On Thu, Oct 13, 2016 at 2:26 AM Glyph Lefkowitz <glyph at twistedmatrix.com>
wrote:

>
> On Oct 12, 2016, at 7:35 PM, Tom Prince <tom.prince at ualberta.net> wrote:
>
> Thinking about it some more, there isn't currently any endpoint
> descriptions that have an empty name, so we could have a entirely new
> syntax that starts with `:`. If we went in that direction, we'd definitely
> want to think about future extensibility when designing it.
>
>
> This applies more generally; no need for any weird hacks.  Any 'new'
> plugin could just opt in to a different syntax; we can just look up until
> the first ':'; we just need to define a new interface for a new syntax.
>
> -glyph
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/twisted-python/attachments/20161013/75847844/attachment-0002.html>


More information about the Twisted-Python mailing list