Originally posted by Jason Yaworsky
Originally posted by Scott Lee
####################################################################### Name: tps_msg_throttle# Programmer: Scott R. Lee# Purpose: Slow down messages going out to EDM. Charges from Affinity# can be sent too quickly for EDM to handle them and # other messages (mainly ADTs) get queued up behind them.## Edits: 6/4/07 - Scott R. Lee# Changed sleep time from 1 second to .5 seconds.# 6/6/07 - Scott R. Lee# Changed sleep time back to 1 second.## UPoC type: tps# Args: tps keyedlist containing the following keys:# MODE run mode ("start", "run" or "time")# MSGID message handle# ARGS user-supplied arguments:# <describe user-supplied args here>## Returns: tps disposition list:# <describe dispositions used here>#proc tps_msg_throttle { args } { keylget args MODE mode ;# Fetch mode set dispList {} ;# Nothing to return switch -exact -- $mode { start { # Perform special init functions # N.B.: there may or may not be a MSGID key in args } run { # 'run' mode always has a MSGID; fetch and process it keylget args MSGID mh echo sleeping 1 sleep 1 lappend dispList "CONTINUE $mh" } time { # Timer-based processing # N.B.: there may or may not be a MSGID key in args } shutdown { # Doing some clean-up work } } return $dispList}