blob: 6f155177d18848aa8a1fb7e61d62d46e7a914da9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
#!/usr/bin/env python
from ivy import Ivy, IvyApplicationAdapter, IvyMessageAdapter
class MyApplicationAdapter (IvyApplicationAdapter):
def connect(self, ivyclient):
print "Connexion de %s"%ivyclient.getName()
class MyMessageAdapter(IvyMessageAdapter):
def receive(self, client, *arg):
print "Message --> %s"%arg[0]
appAdapter=MyApplicationAdapter()
bus=Ivy("tiny test","Hello World",appAdapter)
print "Bus %s"%bus
bus.start("")
bus()
msgAdapter=MyMessageAdapter()
id=bus.bindMsg("([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*)",msgAdapter)
bus.theThread.join(5)
id1=bus.bindMsg("(.*)",msgAdapter)
bus.theThread.join(20)
|