You are viewing a plain text version of this content. The canonical link for it is here.
Posted to proton@qpid.apache.org by Alan Conway <ac...@redhat.com> on 2015/02/25 18:13:48 UTC

PROTON-827: Reactive client binding for the "go" programming language

I plan to start working on a "go" <golang.org> binding for proton. I
envisage a SWIG binding similar to the other swig-based bindings
(python, ruby, etc.) and an API layer similar to the new reactive Python
API (based on the C reactor.)

This will be an exploratory effort to begin with, I'd like to hear from
anybody who might be interested in using such a thing or helping to
implement it.

Cheers,
Alan.


Re: PROTON-827: Reactive client binding for the "go" programming language

Posted by Alan Conway <ac...@redhat.com>.
On Wed, 2015-02-25 at 17:00 -0500, Richard Li wrote:
> +1
> 
> Have you thought about how to integrate Go channels with AMQP links?
> 

I have thought that it seems like a Cool Idea, but I haven't got much
further than that yet :)

> Richard
> 
> On Wed, Feb 25, 2015 at 12:13 PM, Alan Conway <ac...@redhat.com> wrote:
> 
> > I plan to start working on a "go" <golang.org> binding for proton. I
> > envisage a SWIG binding similar to the other swig-based bindings
> > (python, ruby, etc.) and an API layer similar to the new reactive Python
> > API (based on the C reactor.)
> >
> > This will be an exploratory effort to begin with, I'd like to hear from
> > anybody who might be interested in using such a thing or helping to
> > implement it.
> >
> > Cheers,
> > Alan.
> >
> >



Re: PROTON-827: Reactive client binding for the "go" programming language

Posted by Richard Li <ri...@datawire.io>.
+1

Have you thought about how to integrate Go channels with AMQP links?

Richard

On Wed, Feb 25, 2015 at 12:13 PM, Alan Conway <ac...@redhat.com> wrote:

> I plan to start working on a "go" <golang.org> binding for proton. I
> envisage a SWIG binding similar to the other swig-based bindings
> (python, ruby, etc.) and an API layer similar to the new reactive Python
> API (based on the C reactor.)
>
> This will be an exploratory effort to begin with, I'd like to hear from
> anybody who might be interested in using such a thing or helping to
> implement it.
>
> Cheers,
> Alan.
>
>

Re: PROTON-827: Reactive client binding for the "go" programming language

Posted by Alan Conway <ac...@redhat.com>.
I've checked in some initial sketch examples in examples/go, they don't
work yet as the implementation is just stubs but I'd like to hear any
feedback on how they look.

The main difference from python examples is that since Go has good
facilities for creating and listening on connections, and it is more
natural in Go to handle multiple connections concurrently in goroutines,
I am doing all the connection handling in Go and then just running the
reactor on individual connections.

The big question this raises is what we do if a handler on one
connection (e.g. receiving messages) opens a new connection (e.g. to
send messages on a different connection.) The natural Go approach to
this would be to start a new goroutine for the new connection and run it
with a new handler (or in dire straits use a single thread-safe handler
on both)

I need to put together some examples to show what this would look like,
in particular for sending replyto messages - when to use the existing
connection and when to open a new one?

Cheers,
Alan.



Re: PROTON-827: Reactive client binding for the "go" programming language

Posted by Alan Conway <ac...@redhat.com>.
I pushed the first commit on this, just a Url wrapper so far. 



Re: PROTON-827: Reactive client binding for the "go" programming language

Posted by Andrew Stitcher <as...@redhat.com>.
On Thu, 2015-02-26 at 13:43 -0500, Alan Conway wrote:
> On Thu, 2015-02-26 at 09:39 +0000, Dominic Evans wrote:
> > Hi Alan,
> > 
> > -----Alan Conway <ac...@redhat.com> wrote: -----
> > > I plan to start working on a "go" <golang.org> binding for proton. I
> > > envisage a SWIG binding similar to the other swig-based bindings
> > > (python, ruby, etc.) and an API layer similar to the new reactive
> > > Python API (based on the C reactor.)
> > >
> > > This will be an exploratory effort to begin with, I'd like to hear
> > > from anybody who might be interested in using such a thing or helping
> > > to implement it.
> > 
> > This is certainly something I'd be interested in. However, as far as I was aware, the usefulness of SWIG for Go was where you needed to wrapper C++ libraries.
> > 
> > If you're just planning on wrapping the proton-c reactor code, wouldn't we simply use cgo [1]?
> 
> Maybe. The go docs mention both swig and cgo. My initial assumption was
> that since we already have a well defined swig layer that is used by
> everything else, that probably would make sense. However I haven't
> looked at cgo in detail yet so if it has big advantages over swig then
> it is a possibility.

In principle if possible I would avoid using swig!

<aside>
I think it would actually be nice to use cffi for the python bindings -
the fewer extra build dependencies for the minimal testable build the
better.

Since our testing uses python - I would be very much in favour of
recasting the proton.py code in terms of cffi (or similar) and avoid
using the swigged cproton.so library.
</aside>

Andrew




Re: PROTON-827: Reactive client binding for the "go" programming language

Posted by Alan Conway <ac...@redhat.com>.
On Thu, 2015-02-26 at 09:39 +0000, Dominic Evans wrote:
> Hi Alan,
> 
> -----Alan Conway <ac...@redhat.com> wrote: -----
> > I plan to start working on a "go" <golang.org> binding for proton. I
> > envisage a SWIG binding similar to the other swig-based bindings
> > (python, ruby, etc.) and an API layer similar to the new reactive
> > Python API (based on the C reactor.)
> >
> > This will be an exploratory effort to begin with, I'd like to hear
> > from anybody who might be interested in using such a thing or helping
> > to implement it.
> 
> This is certainly something I'd be interested in. However, as far as I was aware, the usefulness of SWIG for Go was where you needed to wrapper C++ libraries.
> 
> If you're just planning on wrapping the proton-c reactor code, wouldn't we simply use cgo [1]?

Maybe. The go docs mention both swig and cgo. My initial assumption was
that since we already have a well defined swig layer that is used by
everything else, that probably would make sense. However I haven't
looked at cgo in detail yet so if it has big advantages over swig then
it is a possibility.

Cheers,
Alan.


Re: PROTON-827: Reactive client binding for the "go" programming language

Posted by Robbie Gemmell <ro...@gmail.com>.
Always remember the newline to protect against automated signatures? :)

On 26 February 2015 at 09:46, Dominic Evans <do...@uk.ibm.com> wrote:
> http://golang.org/cmd/cgo/
>
> :/
>
> --
> Unless stated otherwise above:
> IBM United Kingdom Limited - Registered in England and Wales with number 741598.
> Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU
>

Re: PROTON-827: Reactive client binding for the "go" programming language

Posted by Dominic Evans <do...@uk.ibm.com>.
http://golang.org/cmd/cgo/

:/

-- 
Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 741598. 
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU


Re: PROTON-827: Reactive client binding for the "go" programming language

Posted by Dominic Evans <do...@uk.ibm.com>.
Hi Alan,

-----Alan Conway <ac...@redhat.com> wrote: -----
> I plan to start working on a "go" <golang.org> binding for proton. I
> envisage a SWIG binding similar to the other swig-based bindings
> (python, ruby, etc.) and an API layer similar to the new reactive
> Python API (based on the C reactor.)
>
> This will be an exploratory effort to begin with, I'd like to hear
> from anybody who might be interested in using such a thing or helping
> to implement it.

This is certainly something I'd be interested in. However, as far as I was aware, the usefulness of SWIG for Go was where you needed to wrapper C++ libraries.

If you're just planning on wrapping the proton-c reactor code, wouldn't we simply use cgo [1]?

Cheers,
Dom

[1] http://golang.org/cmd/cgo/Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 741598. 
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU