Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraleherbau2011-05-31 13:20:47 +0000
committeraleherbau2011-05-31 13:20:47 +0000
commit6c66f7e4848a076f553c81bdb64dd85610af2d79 (patch)
tree23a07788884e728dbc5b7ad3e6eaef417a0837e4 /python/src/tcf/protocol.py
parent0e77355b3f6d073cbf77d596308a5a679e7c6f13 (diff)
downloadorg.eclipse.tcf-6c66f7e4848a076f553c81bdb64dd85610af2d79.tar.gz
org.eclipse.tcf-6c66f7e4848a076f553c81bdb64dd85610af2d79.tar.xz
org.eclipse.tcf-6c66f7e4848a076f553c81bdb64dd85610af2d79.zip
TCF Python: Start discovery on demand only
Diffstat (limited to 'python/src/tcf/protocol.py')
-rw-r--r--python/src/tcf/protocol.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/python/src/tcf/protocol.py b/python/src/tcf/protocol.py
index b6644cd8d..1f94ff406 100644
--- a/python/src/tcf/protocol.py
+++ b/python/src/tcf/protocol.py
@@ -28,7 +28,7 @@ _timer_dispatcher = None
def startEventQueue():
global _event_queue, _timer_dispatcher
if _event_queue and not _event_queue.isShutdown(): return
- _event_queue = EventQueue()
+ _event_queue = EventQueue(on_shutdown=shutdownDiscovery)
_event_queue.start()
# initialize LocatorService
from services.local.LocatorService import LocatorService
@@ -159,6 +159,19 @@ def log(msg, x=None):
else:
_logger.log(msg, x)
+def startDiscovery():
+ "Start discovery of remote peers if not running yet"
+ # initialize LocatorService
+ from services.local.LocatorService import LocatorService
+ if LocatorService.locator:
+ invokeAndWait(LocatorService.startup)
+
+def shutdownDiscovery():
+ "Shutdown discovery if running"
+ from tcf.services.local.LocatorService import LocatorService
+ if LocatorService.locator:
+ invokeAndWait(LocatorService.shutdown)
+
def getLocator():
"""
Get instance of the framework locator service.

Back to the top