1 from operationscore.Behavior import *
3 """Timeout is a behavior designed to be used in recursive hooks to stop responses after a certain
4 amount of time. It is the Time-version of RecursiveDecay. Specify:
5 <TimeOut> -- the time in ms that the response will run.
6 """
7
9 ret = []
10 for data in sensorInputs:
11 if not 'StartTime' in data:
12 data['StartTime'] = timeops.time()
13 if timeops.time()-data['StartTime'] < self['Timeout']:
14 ret.append(data)
15 return (ret, [])
16