diff --git a/gateway/vendor/github.com/openfaas/nats-queue-worker/LICENSE b/gateway/vendor/github.com/openfaas/nats-queue-worker/LICENSE new file mode 100644 index 00000000..e3664181 --- /dev/null +++ b/gateway/vendor/github.com/openfaas/nats-queue-worker/LICENSE @@ -0,0 +1,22 @@ +MIT License + +Copyright (c) 2016-2017 Alex Ellis + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + diff --git a/gateway/vendor/github.com/openfaas/nats-queue-worker/README.md b/gateway/vendor/github.com/openfaas/nats-queue-worker/README.md new file mode 100644 index 00000000..616592ba --- /dev/null +++ b/gateway/vendor/github.com/openfaas/nats-queue-worker/README.md @@ -0,0 +1,19 @@ +## Queue worker for OpenFaaS - NATS Streaming + +This is a queue-worker to enable asynchronous processing of function requests. + +> Note: A Kafka queue-worker is under-way through a PR on the main OpenFaaS repository. + +* [Read more in the async guide](https://github.com/openfaas/faas/blob/master/guide/asynchronous.md) + +Hub image: [functions/queue-worker:0.1.1](https://hub.docker.com/r/functions/queue-worker/) + +License: MIT + +Screenshots from keynote / video - find out more over at https://www.openfaas.com/ + +screen shot 2017-10-26 at 15 55 25 + +screen shot 2017-10-26 at 15 55 19 + +screen shot 2017-10-26 at 15 55 06 diff --git a/gateway/vendor/github.com/openfaas/nats-queue-worker/handler/handler.go b/gateway/vendor/github.com/openfaas/nats-queue-worker/handler/handler.go index 8d9b547f..853cd91c 100644 --- a/gateway/vendor/github.com/openfaas/nats-queue-worker/handler/handler.go +++ b/gateway/vendor/github.com/openfaas/nats-queue-worker/handler/handler.go @@ -1,12 +1,12 @@ package handler import ( - "fmt" - "log" - "encoding/json" + "log" + "os" + "fmt" - "github.com/openfaas/faas/gateway/queue" + "github.com/alexellis/faas/gateway/queue" "github.com/nats-io/go-nats-streaming" ) @@ -22,7 +22,8 @@ func CreateNatsQueue(address string, port int) (*NatsQueue, error) { natsURL := fmt.Sprintf("nats://%s:%d", address, port) log.Printf("Opening connection to %s\n", natsURL) - clientID := "faas-publisher" + val, _ := os.Hostname() + clientID := "faas-publisher-" + val clusterID := "faas-cluster" nc, err := stan.Connect(clusterID, clientID, stan.NatsURL(natsURL)) diff --git a/gateway/vendor/github.com/openfaas/nats-queue-worker/queue-worker/vendor.conf b/gateway/vendor/github.com/openfaas/nats-queue-worker/queue-worker/vendor.conf new file mode 100644 index 00000000..5141960c --- /dev/null +++ b/gateway/vendor/github.com/openfaas/nats-queue-worker/queue-worker/vendor.conf @@ -0,0 +1,5 @@ +github.com/alexellis/faas 4cc299d4c84e7ce10c6a5117e918c5a5b4aeb2ae +github.com/nats-io/go-nats-streaming bf8654e90f5296da96eab1e85808eb5c4b7b5541 +github.com/nats-io/go-nats 34c8842105ac0b69c838a9998a239d482936c466 +github.com/nats-io/nuid 3cf34f9fca4e88afa9da8eabd75e3326c9941b44 +github.com/gogo/protobuf dda3e8acadcc9affc16faf33fbb229db78399245