File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 17
17
# https://www.confluent.io/blog/[path-to-blog-post]
18
18
19
19
# Example Siege [https://github.com/JoeDog/siege] test:
20
- # siege -c 400 -r 200 'http://localhost:8000/items1 POST {"name":"testuser"}'
20
+ # $ siege -c 400 -r 200 'http://localhost:8000/items1 POST {"name":"testuser"}'
21
21
22
22
import asyncio
23
23
import confluent_kafka
@@ -46,6 +46,9 @@ def close(self):
46
46
self ._poll_thread .join ()
47
47
48
48
def produce (self , topic , value ):
49
+ """
50
+ An awaitable produce method.
51
+ """
49
52
result = self ._loop .create_future ()
50
53
51
54
def ack (err , msg ):
@@ -57,6 +60,10 @@ def ack(err, msg):
57
60
return result
58
61
59
62
def produce2 (self , topic , value , on_delivery ):
63
+ """
64
+ A produce method in which delivery notifications are made available
65
+ via both the returned future and on_delivery callback (if specified).
66
+ """
60
67
result = self ._loop .create_future ()
61
68
62
69
def ack (err , msg ):
@@ -167,4 +174,4 @@ async def create_item5(item: Item):
167
174
168
175
169
176
if __name__ == '__main__' :
170
- uvicorn .run (app , host = '0 .0.0.0 ' , port = 8000 )
177
+ uvicorn .run (app , host = '127 .0.0.1 ' , port = 8000 )
You can’t perform that action at this time.
0 commit comments