Created
October 8, 2018 05:48
-
-
Save mariotpc/a1e8efa3cfa4a9c7ac20bc4dd144ad06 to your computer and use it in GitHub Desktop.
Nameko microservice RPC
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from nameko.rpc import rpc | |
class FTHService: | |
name = "CelciusToFahrenheit" | |
@rpc | |
def convert (self, Celcius): | |
Fahrenheit = float(int(Celcius) * 1.8) + 32 | |
return "Hello the Fahrenheit Temp is: , {}!".format(Fahrenheit) | |
class HiService: | |
name = "sayHi" | |
@rpc | |
def Hi (self, name): | |
return "Hello World, my Name is: {}!".format(name) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment