Reactive XComponent is a Python client API that allows you to interact with microservices generated with XComponent software.
- Python 3
- Pipenv
Install pipenv (the officially recommended packaging tool for Python):
sudo pip3 install pipenv
Install dependencies:
pipenv install --dev
Run build script:
pipenv run ./build.sh ( or build.bat)
A reactivexcomponent-X.Y.Z.tar.gz
pip package is build on the dist\reactivexcomponent folder.
Create a file called test.py
.
from reactivexcomponent.xcomponent_api import XcomponentAPI
def callback(error, session):
if error is not None:
print('Error connecting to WebSocket bridge')
print(error)
if session is not None:
publisher = session.create_publisher()
publisher.send_message('COMPONENT NAME', 'STATEMACHINE NAME', 'MESSAGE TYPE', { 'JSON': 'MESSAGE' })
xc_api_file = "PATH TO A XCAPI FILE GENERATED BY XCStudio"
server_url = "wss://WEB_SOCKET_BRIDGE_SERVER:443"
api = XcomponentAPI()
api.create_session(xc_api_file, server_url, callback)
Run the Web socket bridge from a XComponent project and then run the test file as python test.py
.
Use the nose runner to run unit tests.
pipenv shell
cd reactivexcomponent
nosetests3 tests/unit reactivexcomponent --exe
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request
Apache License V2