A basic command for stream process to execute is as follows:
faust -A <app_name> worker
app_name
: stream application name(or process name).app_name
should be same with name of python file.- In this demo, you can execute faust stream application with the command as follows:
faust -A main worker
- faust uses RocksDB as memory cache for stateful stream processing.
- This cache is represented as
Table
object.cache = app.Table( "cache_name", partitions=1, default=None, )
- The value of
partitions
parameter should be as same as the number of partitions that consumer(application) subscribe.- For this demo, assume that
chest
topic has only one partition. - Accordingly, the
partition
parameter is just 1.
- For this demo, assume that
Table
object is very similar to dictionary of python.- You can easily access an element of state store with subscription method(
[]
).