Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pdxjohnny/stratus
Python microservice and process communication module
https://github.com/pdxjohnny/stratus
Last synced: about 1 month ago
JSON representation
Python microservice and process communication module
- Host: GitHub
- URL: https://github.com/pdxjohnny/stratus
- Owner: pdxjohnny
- License: mit
- Created: 2015-05-02T20:55:33.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-09-24T00:17:01.000Z (about 9 years ago)
- Last Synced: 2024-09-17T00:05:08.156Z (about 2 months ago)
- Language: Python
- Homepage:
- Size: 383 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
Stratus
---
A module for developing microservices with pythonSee examples for a tutorial
```python
import sys
import uuid
import time
import stratusNUM_SERVICES = 1
SERVICE_NAME = "db"class service(stratus.stratus):
def query(self, obj):
return objdef uuid(self):
return self.namedef say_hello(self, name):
return "Hello " + str(name)def main():
for i in xrange(0 ,NUM_SERVICES):
# Create the service
to_launch = service()
# Name the service
name = SERVICE_NAME + "_" + str(i)
# Connect service to cluster
to_launch.connect(name=name, host=sys.argv[1], service=SERVICE_NAME)
# Host services
while True:
time.sleep(300)if __name__ == '__main__':
main()```