diff options
author | Ilya Etingof <etingof@gmail.com> | 2016-11-05 22:59:31 +0100 |
---|---|---|
committer | Ilya Etingof <etingof@gmail.com> | 2016-11-05 22:59:31 +0100 |
commit | c54a3f6dc8ee433a55001e1cd97f6801bd6e52b7 (patch) | |
tree | 36b8477a686d5e15a8c6ab028626c69e7303eb10 /examples/hlapi/asyncio/agent/ntforg/multiple-notifications-at-once.py | |
parent | a0ef4b6ce81683dc33ae00b3dcedd1c4ec282249 (diff) | |
download | pysnmp-git-asyncio-dispatcher-fixes.tar.gz |
WIP: gracefully shutdown asyncio dispatcherasyncio-dispatcher-fixes
Diffstat (limited to 'examples/hlapi/asyncio/agent/ntforg/multiple-notifications-at-once.py')
-rw-r--r-- | examples/hlapi/asyncio/agent/ntforg/multiple-notifications-at-once.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/examples/hlapi/asyncio/agent/ntforg/multiple-notifications-at-once.py b/examples/hlapi/asyncio/agent/ntforg/multiple-notifications-at-once.py index 027d3ac6..5345e98b 100644 --- a/examples/hlapi/asyncio/agent/ntforg/multiple-notifications-at-once.py +++ b/examples/hlapi/asyncio/agent/ntforg/multiple-notifications-at-once.py @@ -56,7 +56,12 @@ def sendone(snmpEngine, hostname, notifyType): snmpEngine = SnmpEngine() loop = asyncio.get_event_loop() + +# send notifications concurrently loop.run_until_complete( asyncio.wait([sendone(snmpEngine, 'demo.snmplabs.com', 'trap'), sendone(snmpEngine, 'demo.snmplabs.com', 'inform')]) ) + +# this will cancel internal timer +loop.run_until_complete(unconfigureNtfOrg(snmpEngine))
\ No newline at end of file |