grpc added link events
This commit is contained in:
parent
8ee1db5dc8
commit
e282b3b8f8
3 changed files with 186 additions and 2 deletions
|
@ -1,4 +1,5 @@
|
|||
from __future__ import print_function
|
||||
|
||||
import logging
|
||||
import os
|
||||
import threading
|
||||
|
@ -83,6 +84,18 @@ class CoreApiClient(object):
|
|||
thread.daemon = True
|
||||
thread.start()
|
||||
|
||||
def link_events(self, _id, handler):
|
||||
request = core_pb2.LinkEventsRequest()
|
||||
request.id = _id
|
||||
|
||||
def listen():
|
||||
for event in self.stub.LinkEvents(request):
|
||||
handler(event)
|
||||
|
||||
thread = threading.Thread(target=listen)
|
||||
thread.daemon = True
|
||||
thread.start()
|
||||
|
||||
def session_events(self, _id, handler):
|
||||
request = core_pb2.SessionEventsRequest()
|
||||
request.id = _id
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue