Skip to content

xflipped/proxy

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Proxy

Info

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

Run

Environment variables

Variable Default Description
STATEFUN_PROXY_DEBUG "" Debug log level

Functions

Foliage stores stateful functions in a function container:

func_container.png

There are two types of functions: non-grounded and grounded.

Non-grounded functions

non_grounded.png

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

grounded.png

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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 95.1%
  • Dockerfile 4.9%