Releases: jomorais/pyfase
Releases · jomorais/pyfase
Improvements on FSM
- on_idle callback is now called on_default_state
- the on_default_state can be called continuously every on_default_state_time
- add method set_new_default_state_time:
self.set_new_default_state_time(3.5) # sets on_default_state_time to 3.5 seconds
Implementation of a simple Finite-State-Machine inside your service
- Implementation of a simple Finite-State-Machine inside your service. just add a "MicroService.state" decorator upper any method with follow structure: def method_as_state(self, data):
@MicroService.state
def download(self, data):
> put your state logic here <
- to start Finite-State-Machine, you should enable the fsm functionality as follow:
MyService().execute(enable_fsm=True)
- to request a state to be executed, you should call self.request_state method:
self.request_state(next_state='download', data="http://url/file_to_download.json")
## response feature ##
response feature
- When a service A requests an 'action' to service B: service B now can respond to service A by self.response(data) method inside the 'action' context, by this way service B can send some data related about the 'action' previous performed without need to request a new action to service A. see 'database' example
Improvements of broadcast in 1.0.1
Fix name server broadcast issue
Release 1.0.1
- fix setup.py
- rename fase module to pyfase
- service base class is now named "MicroService"