core
contains: TimeRef, Finalizer, Fifo, Mutex and msgpackzmq
contains: non-GUI scheduler, message based networkingmdns
contains: ZeroConflk
contains: sockets, Scheduler, Timer, Thread, network transparency, utilities
package = "lub" | |
version = "1.0.4-1" | |
source = { | |
url = 'https://github.com/lubyk/lub/archive/REL-1.0.4.tar.gz', | |
dir = 'lub-REL-1.0.4', | |
} | |
description = { | |
summary = "Lubyk base module.", | |
detailed = [[ | |
lub: helper code, class declaration. |
class ClubsController < ApplicationController | |
before_filter :check_is_admin | |
layout :admin_layout | |
def club | |
attrs = secure(Node) { Node.transform_attributes(attrs) } | |
zip = attrs.delete('parent_zip') | |
parent = visitor.find_node(nil, zip, nil, request) | |
if !parent.can_write? && !visitor.exec_acl |
binder = dub.LuaBinder() | |
binder.TYPE_TO_NATIVE['FooPtr'] = { | |
type = 'FooPtr', -- not sure why this is needed | |
-- Get value from Lua. | |
pull = function(name, position, prefix) | |
-- Allocate a FooPtr on the stack | |
return format('FooPtr %s = ((Foo**)dub_checksdata(L, %i, "lib.Foo"));', | |
name, position) | |
end, |
#include "dummy/Dummy.h" | |
#include "lua_cpp_helper.h" | |
using namespace dummy; |
#include "lubyk/lua_object.h" | |
#include "lua_cpp_helper.h" | |
using namespace lubyk; | |
LuaObject::LuaObject() throw () | |
: userdata_(NULL), | |
worker_(NULL), | |
class_name_("??") { | |
} |
/** Calls a lua function back. | |
*/ | |
class LuaObject | |
{ | |
/** This is used to invalidate the userdata in case the object is deleted | |
* out of Lua. | |
*/ | |
void **userdata_; | |
public: | |
/** Prepare tables to work with the table based self idion. |
namespace dummy { | |
/** Dummy | |
* | |
* @dub ignore: 'cppOnlyMethod' | |
*/ | |
class Dummy : public ThreadedLuaObject { | |
public: | |
Dummy() {} | |
/** This is only called by C++ but has to be public for xyz reasons so it |
~~~ = link from table with weak values | |
******************************************************************************** | |
State before removing 'foobar': | |
+----------------------------------------+ | |
| | | |
v | | |
scheduler ---> wrap ---> t ~~~> thread ---> coroutine --- (up-value) --> foobar ---> udata | |
^ ^ | |
| | |