Mercurial Hosting > luan
diff src/luan/modules/http/tools/Shell.luan @ 1322:d5739c101bd6
improve Thread
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Wed, 06 Feb 2019 01:11:12 -0700 |
parents | 590ad449ac7f |
children | 1604d7f36f3a |
line wrap: on
line diff
--- a/src/luan/modules/http/tools/Shell.luan Tue Feb 05 22:36:55 2019 -0700 +++ b/src/luan/modules/http/tools/Shell.luan Wed Feb 06 01:11:12 2019 -0700 @@ -21,9 +21,8 @@ local Shell = {} -local forever = Time.period{days=1000000} local count = 0 -local new_session = Thread.global_callable("shell.new_session",forever,{next=function() +local new_session = Thread.global_callable("shell.new_session",{next=function() count = count + 1 return to_string(count) end}).next @@ -57,7 +56,7 @@ local timeout = Time.period{hours=10} local function get_session(session_id) - return Thread.global_callable("shell.session"..session_id,timeout,fns) + return Thread.global_callable("shell.session"..session_id,fns,timeout) end function Shell.respond()