projects
/
arvados.git
/ blob
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
4904: Minimal event subscribe example.
[arvados.git]
/
doc
/
_includes
/
_events_py.liquid
1
#!/usr/bin/env python
2
3
import arvados
4
import arvados.events
5
import json
6
7
# 'ev' is a dict containing the log table record describing the change.
8
def on_message(ev):
9
# Your code here.
10
print json.dumps(ev)
11
12
13
api = arvados.api('v1', cache=False)
14
ws = arvados.events.subscribe(api, [], on_message)
15
ws.run_forever()