Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resume merge and fix #20

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/fetch.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ local ip = arg[2]
local port = arg[3]

local cjson = require'cjson'
local peer = require'jet.peer'.new{ip=ip,port=port}
local peer = require'jet.peer'.new{ip=ip,port=port,persist=100}

local is_json,exp_json = pcall(cjson.decode,exp)
if is_json then
Expand Down
24 changes: 24 additions & 0 deletions examples/persistant_ticker.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env lua
-- example program for manually testing persistant peers
local jet = require'jet'
local ev = require'ev'

assert(arg[1],'ip exepected')

local peer = jet.peer.new({
ip = arg[1],
persist = 10,
})

local tick_tack = peer:state({
path = 'tick_tack',
value = 1
})

ev.Timer.new(function()
local new = tick_tack:value() + 1
print(new)
tick_tack:value(new)
end,1,1):start(ev.Loop.default)

peer:loop()
3 changes: 2 additions & 1 deletion rockspecs/lua-jet-scm-1.rockspec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ dependencies = {
'lua-websockets',
'luasocket',
'lua-ev',
'lpack'
'lpack',
'lua-step'
}

build = {
Expand Down
Loading