-
Notifications
You must be signed in to change notification settings - Fork 33
Add example for python function #70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
tuteng
commented
Apr 1, 2021
- Add example for python function
…streamnative/examples into feature/add-example-for-python-function
└── serde.py | ||
``` | ||
|
||
In python, if a folder contains `__init__` file, we call it a package, python_function and pyserde are both packages. Compressing `python_function` directory will generate `python_function.zip`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In python, if a folder contains `__init__` file, we call it a package, python_function and pyserde are both packages. Compressing `python_function` directory will generate `python_function.zip`. | |
In Python, if a folder contains `__init__` file, it is a package. In this project structure, the `python_function` and `pyserde` are both packages. Compressing `python_function` directory generates the `python_function.zip` file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leave my comment. PTAL.
@@ -0,0 +1,47 @@ | |||
# python-function | |||
|
|||
This is an example of how to use the python function. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an example of how to use the python function. | |
This example describes how to use the Python function. |
|
||
This is an example of how to use the python function. | ||
|
||
## Project Structure |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
## Project Structure | |
## Project structure |
In python, if a folder contains `__init__` file, we call it a package, python_function and pyserde are both packages. Compressing `python_function` directory will generate `python_function.zip`. | ||
|
||
## How to use | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This section describes how to use the Python function.
|
||
## How to use | ||
|
||
### Start pulsar standalone |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
### Start pulsar standalone | |
### Start Pulsar in standalone mode |
## How to use | ||
|
||
### Start pulsar standalone | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This example shows how to start Pulsar in Docker.
bin/pulsar standalone | ||
``` | ||
|
||
### Start python function by use zip package |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
### Start python function by use zip package | |
### Start Python function | |
This example shows how to start Python function through a ZIP package. |
--output-serde-classname python_function.pyserde.serde.CustomSerDe \ | ||
--output output-topic-3 | ||
``` | ||
Replace `YOUR-PATH` with your file path. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace `YOUR-PATH` with your file path. | |
Replace the `YOUR-PATH` parameter with your file path. |
``` | ||
Replace `YOUR-PATH` with your file path. | ||
|
||
### Run produce and consume |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
### Run produce and consume | |
### Run producer and consumer | |
This example shows how to run a producer and a consumer. |
@@ -0,0 +1,47 @@ | |||
# python-function |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# python-function | |
# Python function |