Revision 8b5a4b9a src/Ganeti/JQueue.hs
b/src/Ganeti/JQueue.hs | ||
---|---|---|
36 | 36 |
, fromClockTime |
37 | 37 |
, noTimestamp |
38 | 38 |
, currentTimestamp |
39 |
, advanceTimestamp |
|
39 | 40 |
, setReceivedTimestamp |
40 | 41 |
, opStatusFinalized |
41 | 42 |
, extractOpSummary |
... | ... | |
63 | 64 |
) where |
64 | 65 |
|
65 | 66 |
import Control.Applicative (liftA2, (<|>)) |
66 |
import Control.Arrow (second) |
|
67 |
import Control.Arrow (first, second)
|
|
67 | 68 |
import Control.Concurrent.MVar |
68 | 69 |
import Control.Exception |
69 | 70 |
import Control.Monad |
... | ... | |
117 | 118 |
currentTimestamp :: IO Timestamp |
118 | 119 |
currentTimestamp = fromClockTime `liftM` getClockTime |
119 | 120 |
|
121 |
-- | From a given timestamp, obtain the timestamp of the |
|
122 |
-- time that is the given number of seconds later. |
|
123 |
advanceTimestamp :: Int -> Timestamp -> Timestamp |
|
124 |
advanceTimestamp = first . (+) |
|
125 |
|
|
120 | 126 |
-- | An input opcode. |
121 | 127 |
data InputOpCode = ValidOpCode MetaOpCode -- ^ OpCode was parsed successfully |
122 | 128 |
| InvalidOpCode JSValue -- ^ Invalid opcode |
Also available in: Unified diff