Add support for Async worker

This commit is contained in:
Seif Lotfy
2016-09-19 14:22:48 -07:00
parent b623fc27e4
commit 92df53b144
13 changed files with 285 additions and 342 deletions

View File

@@ -36,6 +36,11 @@ type routesResponse struct {
Routes models.Routes `json:"routes"`
}
type tasksResponse struct {
Message string `json:"message"`
Task models.Task `json:"tasksResponse"`
}
func testRouter() *gin.Engine {
r := gin.Default()
ctx := context.Background()
@@ -44,9 +49,11 @@ func testRouter() *gin.Engine {
c.Set("ctx", ctx)
c.Next()
})
bindHandlers(r, func(ctx *gin.Context) {
handleRequest(ctx, nil)
})
bindHandlers(r,
func(ctx *gin.Context) {
handleRequest(ctx, nil)
},
func(ctx *gin.Context, del bool) {})
return r
}