Proxy listen on URL: http://${address}/proxy
Flink's module.yaml
example:
kind: io.statefun.endpoints.v2/http
spec:
functions: proxy/*
urlPathTemplate: http://${address}/proxy
maxNumBatchRequests: 1
transport:
type: io.statefun.transports.v1/async
connect: 5s
call: 600s
payload_max_bytes: 52428800
Variable | Default | Description |
---|---|---|
STATEFUN_PROXY_DEBUG | "" | Debug log level |
Foliage stores stateful functions in a function container:
There are two types of functions: non-grounded and grounded.
Non-grounded functions exist in a single copy.
To define a function, set the flag grounded
to false
on bootstrap:
function := pbtypes.Function{ FunctionType: &pbtypes.FunctionType{ Namespace: types.Namespace, Type: types.FunctionType, }, Description: types.Description, Grounded: false, }
Each function must have a link with a route to be available for execution. Before creating the link, define a route to the external module that contains the function:
route := &pbtypes.FunctionRoute{ Url: "http://hostname:31001/statefun", }
NOTE: Optional flags ExecuteOnCreate
and ExecuteOnUpdate
are not used for non-grounded functions.
Grounded functions can exist in multiple copies. A copy of the function runs directly on the served node.
To define a function, set the flag grounded
to true
on bootstrap (default):
function := pbtypes.Function{ FunctionType: &pbtypes.FunctionType{ Namespace: types.Namespace, Type: types.FunctionType, }, Description: types.Description, Grounded: true, }
Each function must have a link with a route to be available for execution. Before creating the link, define a route to the external module that contains the function:
route := &pbtypes.FunctionRoute{ Url: "http://hostname:31001/statefun", ExecuteOnCreate: true, ExecuteOnUpdate: true, }
NOTE: Optional flags ExecuteOnCreate
and ExecuteOnUpdate
can be used for grounded functions to trigger a function on create and/or update action.