DR-TarantoolQueue

 view release on metacpan or  search on metacpan

lib/DR/TarantoolQueue.pm  view on Meta::CPAN


For the case the driver uses the following lua code:
    
    log.info('Fake Queue starting')
    
    box.cfg{ listen  = os.getenv('PRIMARY_PORT') }
    
    box.schema.user.create('test', { password = 'test' })
    box.schema.user.grant('test', 'read,write,execute', 'universe')
    
    _G.queue = require('megaqueue')
    queue:init()
    
    log.info('Fake Queue started')

=head2 msgpack (ro)

If true, the driver will use L<DR::Tnt> driver (C<1.6>). Also it will use
L<tarantool-megaqueue|https://github.com/dr-co/tarantool-megaqueue> lua
module with namespace C<queue>.

lib/DR/TarantoolQueue/Tnt.pm  view on Meta::CPAN

        my $t = DR::Tnt::Test::start_tarantool(
            -port       => DR::Tnt::Test::free_port(),
            -make_lua   => q{
                require('log').info('Fake Queue starting')
                box.cfg{
                    listen      = os.getenv('PRIMARY_PORT'),
                    readahead   = 101024
                }
                box.schema.user.create('test', { password = 'test' })
                box.schema.user.grant('test', 'read,write,execute', 'universe')
                _G.queue = require('megaqueue')
                queue:init()
                require('log').info('Fake Queue started')
            }
        );

        unless ($t->is_started) {
            warn $t->log;
            die "Can't start fake tarantool\n";
        }
        return $t;

t/020-tnt-msgpack/lua/queue.lua  view on Meta::CPAN

local log = require 'log'
local json = require 'json'
local fio = require 'fio'

box.cfg{ listen  = os.getenv('PRIMARY_PORT'), readahead = 10240000 }

box.schema.user.create('test', { password = 'test' })
box.schema.user.grant('test', 'read,write,execute', 'universe')

local megaqueue_path =
    fio.pathjoin(
        fio.dirname(
            fio.dirname(

t/020-tnt-msgpack/lua/queue.lua  view on Meta::CPAN

    )

package.path =
    fio.pathjoin(megaqueue_path, '?.lua;') ..
    fio.pathjoin(megaqueue_path, '?/init.lua;') ..
    package.path




_G.queue = require('megaqueue')
queue:init()



( run in 0.296 second using v1.01-cache-2.11-cpan-0d8aa00de5b )