Skip to content

Commit

Permalink
deployment descriptor and stop condition
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavel Kraynyukhov committed Jul 16, 2018
1 parent ee62516 commit 76d693c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 6 additions & 0 deletions examples/time_broadcast/time_broadcast.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name" : "time_broadcast",
"internal": true,
"instances" : 1,
"auto_start": true
}
6 changes: 1 addition & 5 deletions examples/time_broadcast/time_broadcast.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,13 @@ time_broadcast["run"]=function()
"cid" : 5,
"message" : [ "" ]
}]]);
while true
while not must_stop()
do
time_broadcast.nap:usleep(1000000);
local timenow=os.time();
local timestr=os.date("%c",timenow);
oon.message[1]="Server time: "..timestr;
bcast:send(1000,oon);
if(must_stop())
then
break;
end
end
end

Expand Down

0 comments on commit 76d693c

Please sign in to comment.