Installation
Install with pip
Pre-release versions are also published to PyPI. Get them with:
Create your first service
A nameko service is just a class:
from nameko.rpc import rpc
class GreetingService:
name = "greeting_service"
@rpc
def hello(self, name):
return u"Hello, {}!".format(name)
This service is using the built-in @rpc
entrypoint, which is an RPC implementation that sends messages via a RabbitMQ broker.
You can run it using the CLI:
And call it using the convenience shell
command:
Info
This example needs a RabbitMQ broker. The RabbitMQ installation guidelines offer several installation options, but you can quickly start one using Docker: