-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
included macros for lua 5.2 and 5.3 compatibility, replaced test.lua …
…with hello.lua, updated CHANGELOG.
- Loading branch information
Showing
4 changed files
with
69 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,22 @@ | ||
local luaproc = require "luaproc" | ||
-- load luaproc | ||
luaproc = require "luaproc" | ||
|
||
-- create an additional worker | ||
luaproc.setnumworkers( 2 ) | ||
|
||
-- create a new lua process | ||
luaproc.newproc( [[ | ||
-- create a communication channel | ||
luaproc.newchannel( "testchannel" ) | ||
luaproc.newchannel( "achannel" ) | ||
-- create a sender lua process | ||
luaproc.newproc( [=[ | ||
-- send a message | ||
luaproc.send( "testchannel", "luaproc seems to be working fine" ) | ||
luaproc.send( "achannel", "hello world from luaproc" ) | ||
]=] ) | ||
-- create a receiver lua process | ||
luaproc.newproc( [=[ | ||
-- receive and print a message | ||
print( luaproc.receive( "testchannel" )) | ||
print( luaproc.receive( "achannel" )) | ||
]=] ) | ||
]] ) | ||
|