Skip to content

MetaCall complete example with Function Mesh between multiple programming languages.

License

Notifications You must be signed in to change notification settings

metacall/function-mesh-example

Repository files navigation

M E T A C A L L

M E T A C A L L

MetaCall complete example with Function Mesh between multiple programming languages.

Motivation

This example has been designed in order to illustrate the differences between the MetaCall Function Mesh and a typical Service Mesh such as Istio.

The complexity of State of The Art Service Meshes makes it difficult to develop applications because it requires the developer to have knowledge in multiple areas of expertise. The plumbing becomes difficult and tedious, meanwhile with Function Mesh there is no plumbing, only function calls.

MetaCall Core allows to do call functions between languages and the plumbing and scalability is automatically done by the FaaS.

Architecture Overview

MetaCall Function Mesh Overview

Running the example with Docker

It is possible to run and test the Function Mesh locally through MetaCall CLI in Docker. So there is no need to install all dependencies in your environment.

Docker

docker build -t metacall/function_mesh_example .
docker run -it metacall/function_mesh_example

Docker Compose

docker-compose build
docker-compose run example

Testing the example

Input commands are the ones after the > symbol (type help to show all command list).

> load py frontend/frontend.py
Script (frontend/frontend.py) loaded correctly
> inspect
runtime node {
    module react {
        function ReactIndexPage(name)
    }
}
runtime py {
    module frontend {
        function convert(html)
        function index()
    }
}
> call index()
...
> call convert("<html><head><title>Example Html</title></head><body>Hello World</body></html>")
...
> exit