View tnteval
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
#!/usr/bin/env tarantool | |
local CONSOLE_SOCKET_PATH = 'unix/:/var/run/tarantool/tarantool.sock' | |
local os = require("os") | |
console = require('console') | |
console.on_start(function(self) | |
local status, reason | |
status, reason = pcall(function() require('console').connect(CONSOLE_SOCKET_PATH) end) | |
if not status then |
View app.js
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
const getLink = node => { | |
if (!node) { | |
return undefined | |
} | |
return node.href ? node : getLink(node.parentNode) | |
} | |
const onClick = e => { |
View Makefile
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
CLEAN: | |
docker-compose down -v | |
START: | |
docker-compose up | |
RUN: CLEAN START |
View app.lua
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
-- other options setup in tarantool-entrypoint.lua see: https://github.com/tarantool/docker | |
box.cfg { | |
log_level = tonumber(os.getenv("TARANTOOL_LOG_LEVEL")); | |
replicaset_uuid = os.getenv("TARANTOOL_REPLICASET_UUID"); | |
instance_uuid = os.getenv("TARANTOOL_INSTANCE_UUID"); | |
memtx_max_tuple_size = 1048576 + 200; | |
force_recovery = true; | |
checkpoint_interval = 30; | |
checkpoint_count = 3; | |
} |
View some_tarantool_queue.lua
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
-- schema: key, group, weight, status, time | |
box.schema.space.create(rehab_space, { if_not_exists = true, temporary = true }) | |
box.space[rehab_space]:create_index('primary', { type = 'TREE', unique = true, parts = { 1, 'string' }, if_not_exists = true }) | |
box.space[rehab_space]:create_index('group', { type = 'TREE', unique = false, parts = { 2, 'unsigned', 4, 'unsigned', 3, 'unsigned' }, if_not_exists = true }) | |
box.space[rehab_space]:create_index('time', { type = 'TREE', unique = false, parts = { 5, 'number' }, if_not_exists = true }) | |
----------------- | |
local function rehab_release(key) | |
this.spaces.boxrehab:delete({ key }) | |
end |
View test.lua
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
local log_level = 5 | |
box.cfg { | |
username = nil; | |
work_dir = nil; | |
wal_dir = "/tmp"; | |
snap_dir = "/tmp"; | |
vinyl_dir = "/tmp"; | |
listen = 3301; |
View bloomfilter_concept_example.lua
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
local bloom = require('bloomfilter') | |
local bloom_options = {size = 512, hash = 3} | |
local bf_instance = bloom.new(bloom_options) | |
local init_state = nil | |
local somedata = "Data" | |
local somedata2 = "Data2" | |
-- now the filter is filled with zeros |
View main.go
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
package main | |
import ( | |
"log" | |
"time" | |
"github.com/garyburd/redigo/redis" | |
"github.com/youtube/vitess/go/pools" | |
"golang.org/x/net/context" | |
"sync" |
View get.c
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
#include "module.h" | |
#include "msgpuck.h" | |
int get(box_function_ctx_t *ctx, const char *args, const char *args_end) { | |
// primary index is 0 | |
uint32_t index_id = 0; | |
uint32_t arg_count = mp_decode_array(&args); |
View remote-multi-call-example.lua
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
box.cfg { | |
username = nil; | |
work_dir = nil; | |
wal_dir = "."; | |
snap_dir = "."; | |
sophia_dir = "."; | |
listen = 3307; | |
pid_file = "example.pid"; | |
background = true; |
NewerOlder