Skip to content

Commit

Permalink
more doc
Browse files Browse the repository at this point in the history
  • Loading branch information
tariqdaouda committed Mar 9, 2022
1 parent 7e0e40c commit b4442ce
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 5 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ BLUMYCELIUM allows you to write complex microservice orchestration all in python
Readthedocs documentation
=========================

This part is a work in progress
We provide a full documentation here (work in progress):

[here](https://duckduckgo.com)
14 changes: 12 additions & 2 deletions blumycelium/docs/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,22 @@ Run the simple example below
#NOTICE THAT TASK ARE FUNCTION WITH NAMES STARING WITH 'task_'
class PrinterElf(melf.MachineElf):
"""docstring for Printer"""
"""
Notice the hint for the return. This is mandatory.
Type hints can also be used for arguments to ensure that tasks get
arguments of the right type.
"""
def task_print_it(self, to_print) -> None:
print(">>> Machine >>> Elf >>> Printer: '%s'" % to_print)
class SenderElf(melf.MachineElf):
"""docstring for Printer"""
"""
Notice the hint for the return. This is mandatory.
Type hints can also be used for arguments to ensure that tasks get
arguments of the right type.
Task must return either None or a dict. Here the return is a tuple of keys to a dictioray.
A list would also work, as well as a dict of types example: {"value": float}
"""
def task_send(self, to_send) -> ("value", ):
return {
"value": to_send
Expand Down
14 changes: 12 additions & 2 deletions demos/basic_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,22 @@
#NOTICE THAT TASK ARE FUNCTION WITH NAMES STARING WITH 'task_'

class PrinterElf(melf.MachineElf):
"""docstring for Printer"""
"""
Notice the hint for the return. This is mandatory.
Type hints can also be used for arguments to ensure that tasks get
arguments of the right type.
"""
def task_print_it(self, to_print) -> None:
print(">>> Machine >>> Elf >>> Printer: '%s'" % to_print)

class SenderElf(melf.MachineElf):
"""docstring for Printer"""
"""
Notice the hint for the return. This is mandatory.
Type hints can also be used for arguments to ensure that tasks get
arguments of the right type.
Task must return either None or a dict. Here the return is a tuple of keys to a dictioray.
A list would also work, as well as a dict of types example: {"value": float}
"""
def task_send(self, to_send) -> ("value", ):
return {
"value": to_send
Expand Down

0 comments on commit b4442ce

Please sign in to comment.