Repository: qpid-proton Updated Branches: refs/heads/proton-go bd3fb337c -> e3c434d41
PROTON-827: Updated README, removed redundant "go" symlink Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/e3c434d4 Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/e3c434d4 Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/e3c434d4 Branch: refs/heads/proton-go Commit: e3c434d41da24eb689aaef9d2cf0b63af85363c1 Parents: bd3fb33 Author: Alan Conway <[email protected]> Authored: Mon Sep 28 15:59:51 2015 -0400 Committer: Alan Conway <[email protected]> Committed: Mon Sep 28 17:08:33 2015 -0400 ---------------------------------------------------------------------- examples/go/README.md | 33 +++++++++++++++++++-------------- go | 1 - proton-c/bindings/go/README.md | 24 +++++++++--------------- 3 files changed, 28 insertions(+), 30 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/e3c434d4/examples/go/README.md ---------------------------------------------------------------------- diff --git a/examples/go/README.md b/examples/go/README.md index 33c3d88..c0bfd85 100644 --- a/examples/go/README.md +++ b/examples/go/README.md @@ -1,13 +1,13 @@ # Go examples for proton -There are 3 go packages for proton: +There are 3 Go packages for proton: -- qpid.apache.org/proton/amqp: converts AMQP messages and data types to and from Go data types. -- qpid.apache.org/proton/concurrent: easy-to-use, concurrent API for concurrent clients and servers. -- qpid.apache.org/proton: Low-level access to the proton engine. +- qpid.apache.org/proton/concurrent: Easy-to-use, concurrent API for concurrent clients and servers. +- qpid.apache.org/proton/amqp: Convert AMQP messages and data to and from Go data types. +- qpid.apache.org/proton: Direct access to the event-driven, concurrent-unsafe proton library. -Most applications should use the `proton/concurrent` package. The `proton` package is for -applications that need low-level access to the proton engine. +Most applications should use the `concurrent` package. The `proton` package is +for applications that need low-level access to the proton library. ## Example programs @@ -16,10 +16,13 @@ applications that need low-level access to the proton engine. ## Using the Go packages -Set your GOPATH environment variable to include `/<path-to-proton>/proton-c/bindings/go` +Use `go get qpid.apache.org/proton/concurrent` or check out the proton +repository and set your GOPATH environment variable to include +`/<path-to-proton>/proton-c/bindings/go` The proton Go packages include C code so the cgo compiler needs to be able to -find the proton library and include files. There are a couple of ways to do this: +find the proton library and include files. There are a couple of ways to do +this: 1. Build proton in directory `$BUILD`. Source the script `$BUILD/config.sh` to set your environment. @@ -51,9 +54,10 @@ You can compile the program first and then run the executable to avoid the delay All the examples take a `-h` flag to show usage information, and the comments in the example source have more details. -First start the broker: +First start the broker (the optional `-debug` flag will print extra information about +what the broker is doing) - go run reactor_broker.go + go run broker.go -debug Send messages concurrently to queues "foo" and "bar", 10 messages to each queue: @@ -63,14 +67,15 @@ Receive messages concurrently from "foo" and "bar". Note -count 20 for 10 messag go run receive.go -count 20 localhost:/foo localhost:/bar -The broker and clients use the amqp port on the local host by default, to use a -different address use the `-addr host:port` flag. +The broker and clients use the standard AMQP port (5672) on the local host by +default, to use a different address use the `-addr host:port` flag. -You can mix it up by running the Go clients with the python broker: +If you have the full proton repository checked out you can try try using the +python broker with Go clients: python ../python/broker.py Or use the Go broker and the python clients: python ../python/simple_send.py - python ../python/simple_recv.py`. + python ../python/simple_recv.py http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/e3c434d4/go ---------------------------------------------------------------------- diff --git a/go b/go deleted file mode 120000 index d6afbc5..0000000 --- a/go +++ /dev/null @@ -1 +0,0 @@ -proton-c/bindings/go/src/qpid.apache.org/proton/go \ No newline at end of file http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/e3c434d4/proton-c/bindings/go/README.md ---------------------------------------------------------------------- diff --git a/proton-c/bindings/go/README.md b/proton-c/bindings/go/README.md index 98a432a..14ccf0f 100644 --- a/proton-c/bindings/go/README.md +++ b/proton-c/bindings/go/README.md @@ -1,7 +1,7 @@ -# *EXPERIMENTAL* Go binding for proton +# Go binding for proton -This is an *experimental* [Go](http://golang.org) binding for proton. -The API is subject to change but there is enough to get a good idea of where it is headed. +This is a a [Go](http://golang.org) binding for proton. +The API is subject to change but is stabilizing. Feedback is strongly encouraged: @@ -10,8 +10,8 @@ Feedback is strongly encouraged: The package documentation is available at: <http://godoc.org/qpid.apache.org/proton> -See the [examples](../../../examples/go/README.md) for working examples and -practical instructions on how to get started. +See the [examples](https://github.com/apache/qpid-proton/blob/master/examples/cpp/README.mdw) +for working examples and practical instructions on how to get started. The rest of this page discusses the high-level goals and design issues. @@ -125,9 +125,6 @@ loops for each connection. ### Design of the concurrent API -The details are still being worked out (see the code) but some basic principles have been -established. - Code from the `proton` package runs _only_ in a dedicated goroutine (per connection). This makes it safe to use proton C data structures associated with that connection. @@ -138,13 +135,10 @@ function into the proton goroutine via a special channel. Injected functions can use temporary channels to allow the calling code to wait for results. Such waiting is only for the local event-loop, not across network calls. -The API exposes blocking calls returning normal error values, no exposed -channels or callbacks. The user can write simple blocking code or start their -own goroutine loops and channels as appropriate. Details of our internal channel -use and error handling are hidden, which simplifies the API and gives us more -implementation flexibility. - -TODO: lifecycle rules for proton objects. +The API exposes blocking calls returning normal error values. The user can write +simple blocking code or start their own goroutine loops and channels as +appropriate. Details of our internal channel use and error handling are hidden, +which simplifies the API and gives us more implementation flexibility. ## New to Go? --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
