summaryrefslogtreecommitdiff
path: root/src/command_queue.lua
diff options
context:
space:
mode:
Diffstat (limited to 'src/command_queue.lua')
-rw-r--r--src/command_queue.lua12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/command_queue.lua b/src/command_queue.lua
index 041e63a..7f95d9b 100644
--- a/src/command_queue.lua
+++ b/src/command_queue.lua
@@ -1,15 +1,15 @@
--
-- gcsd
--
--- gcsd the generic command sequencer daemon can be used to serialize
+-- gcsd the generic command sequencer daemon can be used to serialize
-- commands sent over various paralell communication channels to a
-- single command output. It can be seen as a multiplexer for any
-- kind of communication between a single resource and various clients
-- which want to submit commands to it or query information from it.
--- gcsd is written in C and Lua. The goal is to provide an easy to
+-- gcsd is written in C and Lua. The goal is to provide an easy to
-- understand high level API based on Lua which can be used to
-- implement the business logic of the so formed multiplexer daemon.
---
+--
--
-- Copyright (C) 2009-2010 Markus Grueneis <gimpf@spreadspace.org>
-- Christian Pointner <equinox@spreadspace.org>
@@ -76,7 +76,7 @@ end
function command_queue:command_sent()
if(self.current == nil) then return end
-
+
self.current.sent = true
if(self.current.timeout) then
self.current.expiration_time = timer.now() + self.current.timeout
@@ -93,7 +93,7 @@ end
function command_queue:check_timeout()
if(self.current == nil or not self.current.sent) then return end
if(not self.current.expiration_time) then return end
-
+
if(timer.cmp(timer.now(), self.current.expiration_time) == 1) then
log.printf(log.NOTICE, "command timed out")
self:command_completed()
@@ -102,7 +102,7 @@ end
function command_queue:command_completed()
if(self.current == nil) then return end
-
+
table.remove(self.commands, 1)
self.current = nil
end