Skip to content

Commit 5d99fce

Browse files
committed
polish
1 parent 874b97b commit 5d99fce

4 files changed

Lines changed: 14 additions & 6 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# cookiecutter-autobahn-python
22

3-
Cookiecutter project template for Autobahn Python.
3+
Cookiecutter project template for Autobahn Python, using Docker.
44

55
Usage:
66

{{cookiecutter.service_name}}/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# {{cookiecutter.service_title}}
22

3-
[Autobahn Python](https://github/crossbario/autobahn-python) based service:
3+
[Autobahn|Python](https://github/crossbario/autobahn-python) based service:
44

55
* service title: **"{{cookiecutter.service_title}}"**
66
* service name: **{{cookiecutter.service_name}}**

{{cookiecutter.service_name}}/client_aio.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
import asyncio
1111

12-
from autobahn.wamp.types import RegisterOptions
12+
from autobahn.wamp.types import RegisterOptions, PublishOptions
1313
from autobahn.asyncio.wamp import ApplicationSession, ApplicationRunner
1414

1515

@@ -77,7 +77,11 @@ def oncounter(counter, id, type):
7777
raise e
7878

7979
# PUBLISH
80-
self.publish('com.example.oncounter', counter, self._ident, self._type)
80+
self.publish('com.example.oncounter',
81+
counter,
82+
self._ident,
83+
self._type,
84+
options=PublishOptions(exclude_me=False, acknowledge=True))
8185
print('----------------------------')
8286
self.log.info("published to 'oncounter' with counter {counter}",
8387
counter=counter)

{{cookiecutter.service_name}}/client_tx.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from twisted.internet.defer import inlineCallbacks
1515

1616
from autobahn.twisted.util import sleep
17-
from autobahn.wamp.types import RegisterOptions
17+
from autobahn.wamp.types import RegisterOptions, PublishOptions
1818
from autobahn.twisted.wamp import ApplicationSession, ApplicationRunner
1919
from autobahn.wamp.exception import ApplicationError
2020

@@ -82,7 +82,11 @@ def oncounter(counter, id, type):
8282
raise e
8383

8484
# PUBLISH
85-
yield self.publish('com.example.oncounter', counter, self._ident, self._type)
85+
yield self.publish('com.example.oncounter',
86+
counter,
87+
self._ident,
88+
self._type,
89+
options=PublishOptions(exclude_me=False, acknowledge=True))
8690
print('----------------------------')
8791
self.log.info("published to 'oncounter' with counter {counter}",
8892
counter=counter)

0 commit comments

Comments
 (0)