This repository was archived by the owner on Feb 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.txt
More file actions
59 lines (49 loc) · 1.34 KB
/
example.txt
File metadata and controls
59 lines (49 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import pprint
import logging
from streamdal import (
Audience,
StreamdalClient,
StreamdalConfig,
ProcessRequest,
MODE_CONSUMER,
)
def main():
logging.basicConfig()
client = StreamdalClient(
cfg=StreamdalConfig(
service_name="streamdaltest",
dry_run=True,
streamdal_url="streamdal-server.dev.svc.cluster.local:8082",
streamdal_token="1234",
audiences=[
Audience(
service_name="streamdaltest",
operation_name="opname",
component_name="comname",
operation_type=MODE_CONSUMER,
)
],
)
)
req = ProcessRequest(
operation_type=MODE_CONSUMER,
operation_name="opname",
component_name="comname",
data=b'{"object": {"field": true}}',
)
res = client.process(req)
pprint.pprint(res)
# while not client.cfg.exit.is_set():
# time.sleep(2)
# req = ProcessRequest(
# operation_type=MODE_CONSUMER,
# operation_name="opname",
# component_name="comname",
# data=b'{"object": {"field": true}}',
# )
# res = client.process(req)
#
# pprint.pprint(res)
print("done")
if __name__ == "__main__":
main()