My favorites | Sign in
Project Home Downloads Wiki Source
Checkout   Browse   Changes    
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/python

import Axon
class ShutterDown(Axon.Component.component):
def main(self):
lasttick = self.scheduler.time
start = lasttick
print ("tick")
while 1:
if self.scheduler.time - start > 2:
break
if self.scheduler.time - lasttick> 0.5:
print ("tick")
lasttick = self.scheduler.time
yield 1
print ("stopped")
self.scheduler.stop()

class Eternal(Axon.Component.component):
def main(self):
while 1:
self.pause()
yield 1

def stop(self):
print ("Urgent shutdown here, honest gov!")
super(Eternal,self).stop()

Eternal().activate()

ShutterDown().run()

Change log

r7297 by sparks.m on Feb 15, 2011   Diff
Python 2/3 compatible fix
Go to: 
Sign in to write a code review

Older revisions

r4536 by ms_ on Jun 20, 2008   Diff
M      Axon/Axon/Box.py

    Added Axon.Box.ShowAllTransits -
if set to trye, shows all deliveries
to
...
r4535 by ms_ on Jun 20, 2008   Diff
New Example showing the new nice way
to ask the system as a whole to
shutdown, and also
how components can cope with the fact
...
All revisions of this file

File info

Size: 750 bytes, 31 lines

File properties

svn:executable
*
Powered by Google Project Hosting