jacs 0.4.2 → 0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/actionjabber.rb +5 -1
- metadata +2 -3
data/lib/actionjabber.rb
CHANGED
@@ -31,7 +31,7 @@ module ActionJabber
|
|
31
31
|
@debug = debug
|
32
32
|
end
|
33
33
|
# Initiates the loop to check for new messages.
|
34
|
-
def run!
|
34
|
+
def run!(frequency = 0)
|
35
35
|
while @jabber.connected?
|
36
36
|
@jabber.received_messages do |message|
|
37
37
|
start = Time.now
|
@@ -64,6 +64,10 @@ module ActionJabber
|
|
64
64
|
end
|
65
65
|
#puts "\n"
|
66
66
|
end
|
67
|
+
if frequency > 0
|
68
|
+
# Keep it from hogging up CPU cycles.
|
69
|
+
sleep frequency
|
70
|
+
end
|
67
71
|
end
|
68
72
|
end
|
69
73
|
# Handles actually sending response data to the client.
|