Module

Bucketchain.SimpleAPI.Batch

#BatchParams

type BatchParams = Array { body :: Foreign, path :: String }

This is for internal. Do not use it.

#Batch

newtype Batch a

The type for enable batch operation.

The batch operation is a mechanism running multiple Proc in one HTTP request.

How to use:

withSimpleAPI appContext $ Batch { firstEndpoint, secondEndpoint }

Request POST /batch with body:

[
  { "path": "/firstEndpoint" },
  { "path": "/secondEndpoint", "body": { "num": 1 } }
]

You will get results like:

[
  {
    "status": 500,
    "body": { "message": "Internal server error" }
  },
  {
    "status": 201,
    "body": { "name": "foo" }
  }
]

Note: POST /batch responds 200 always.

Constructors

Modules