Migrate away from queue type in faas project

The queue type now resides in the provider, so that there is
no risk of a circular reference.

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
This commit is contained in:
Alex Ellis (OpenFaaS Ltd)
2021-07-26 17:21:20 +01:00
committed by Alex Ellis
parent 06a51373e2
commit 58394bb1de
101 changed files with 10232 additions and 1763 deletions

View File

@ -12,15 +12,16 @@ import (
"strings"
"github.com/gorilla/mux"
ftypes "github.com/openfaas/faas-provider/types"
"github.com/openfaas/faas/gateway/metrics"
"github.com/openfaas/faas/gateway/queue"
"github.com/openfaas/faas/gateway/scaling"
)
const queueAnnotation = "com.openfaas.queue"
// MakeQueuedProxy accepts work onto a queue
func MakeQueuedProxy(metrics metrics.MetricOptions, queuer queue.RequestQueuer, pathTransformer URLPathTransformer, defaultNS string, functionQuery scaling.FunctionQuery) http.HandlerFunc {
func MakeQueuedProxy(metrics metrics.MetricOptions, queuer ftypes.RequestQueuer, pathTransformer URLPathTransformer, defaultNS string, functionQuery scaling.FunctionQuery) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
if r.Body != nil {
defer r.Body.Close()
@ -48,7 +49,7 @@ func MakeQueuedProxy(metrics metrics.MetricOptions, queuer queue.RequestQueuer,
return
}
req := &queue.Request{
req := &ftypes.QueueRequest{
Function: name,
Body: body,
Method: r.Method,