mirror of
https://github.com/openfaas/faas.git
synced 2025-06-21 22:33:23 +00:00
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:
committed by
Alex Ellis
parent
06a51373e2
commit
58394bb1de
@ -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,
|
||||
|
Reference in New Issue
Block a user