Skip to content
Snippets Groups Projects
Commit 032ac164 authored by ocelot-inc's avatar ocelot-inc
Browse files
parents 5007a096 e150b8a6
No related branches found
No related tags found
No related merge requests found
......@@ -2,6 +2,8 @@
C
=====================================================================
:c:func:`tarantoolc:tnt_connect`
Here follow two examples of using Tarantool's high-level C API.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
......@@ -15,7 +17,7 @@ space :code:`examples` via the high-level C API.
#include <stdio.h>
#include <stdlib.h>
#include <tarantool/tarantool.h>
#include <tarantool/tnt_net.h>
#include <tarantool/tnt_opt.h>
......@@ -149,7 +151,7 @@ requests in the box library.
In this program, the choice is to do an INSERT request, so
the program passes the ``tnt_stream`` that was used for connection
(:code:`tnt`) and the stream that was set up with :func:`tnt_object_format`
(:code:`tnt`) and the stream that was set up with :c:func:`tarantoolc:tnt_object_format`
(:code:`tuple`).
Function description:
......@@ -187,7 +189,7 @@ Function description:
void tnt_reply_free(struct tnt_reply \*r)
**TEARDOWN:** When a session ends, the connection that was made with
:func:`tnt_connect()` should be closed, and the objects that were made in the setup
:c:func:`tarantoolc:tnt_connect()` should be closed, and the objects that were made in the setup
should be destroyed.
.. code-block:: c
......
......@@ -18,7 +18,8 @@ extensions = [
'ext.LuaLexer',
'ext.TapLexer',
'ext.TarantoolSessionLexer',
'breathe'
'breathe',
'sphinx.ext.intersphinx',
]
primary_domain = 'lua'
templates_path = ['../_templates']
......@@ -83,13 +84,13 @@ rst_prolog = """
.. role:: codebolditalic
:class: ccodebi
.. role:: codegreen
:class: ccodegreen
.. role:: codered
:class: ccodered
.. role:: codeblue
:class: ccodeblue
......@@ -103,11 +104,8 @@ rst_epilog = """
<br />
"""
# def setup(sphinx):
# sys.path.insert(0, os.path.abspath('./ext'))
# from LuaLexer import LuaLexer
# sphinx.add_lexer("lua_tarantool", LuaLexer())
# from TarantoolSessionLexer import TarantoolSessionLexer
# sphinx.add_lexer("tarantoolsession", TarantoolSessionLexer())
# from TapLexer import TAPLexer
# sphinx.add_lexer('tap', TAPLexer())
intersphinx_mapping = {
'tarantoolc': ('http://tarantool.github.io/tarantool-c/', None)
}
intersphinx_cache_limit = 0
---
title : "Tarantool - A NoSQL database running in a Lua application server"
slug : "index_308"
save_as : "index_308.html"
template: "index_308"
slug : "index_200"
save_as : "index_200.html"
template: "index_200"
blocks :
header:
- "Tarantool"
......
......@@ -150,8 +150,8 @@ local group_name
--
-- overrides for defaults files
--
-- local instance_dir
-- local default_cfg
local instance_dir
local default_cfg
--
-- print usage and exit
......@@ -240,17 +240,24 @@ end
--
-- System-wide default file may be missing, this is OK, we'll assume built-in
-- defaults
-- It uses sandboxing for isolation. It's not completely safe, but it won't
-- allow a pollution of global variables
--
local function load_default_file(default_file)
if default_file then
local success, data = pcall(dofile, default_file)
local env = setmetatable({}, { __index = _G })
local ufunc, msg = loadfile(default_file)
-- if load fails - show last 10 lines of the log file
if not success then
log.error("Failed to load defaults file: %s", data)
if fio.stat(default_cfg.logger) then
os.execute('tail -n 10 ' .. default_cfg.logger)
end
if not ufunc then
log.error("Failed to load defaults file: %s", msg)
end
debug.setfenv(ufunc, env)
local state, msg = pcall(ufunc)
if not state then
log.error('Failed to execute defaults file: %s', msg)
end
default_cfg = env.default_cfg
instance_dir = env.instance_dir
end
local d = default_cfg or {}
......
brew install openssl
sudo pip install python-daemon PyYAML
sudo pip install six==1.9.0
sudo pip install gevent
......
......@@ -172,29 +172,29 @@ do
if interval == nil then
break
end
if self.control:get(interval) == nil then
fiber.sleep(interval)
if self.reloaded ~= true then
local s, e = pcall(process, self)
if not s then
log.error(e)
end
else
self.reloaded = false
log.info("reloaded")
end
end
log.info("stopped")
self.control:close()
self.control = nil
self.fiber = nil
end
local function reload(self)
if self.snapshot_period > 0 and self.fiber == nil then
self.control = fiber.channel(5)
self.fiber = fiber.create(daemon_fiber, self)
elseif self.fiber ~= nil then
-- wake up daemon
self.control:put(true)
self.reloaded = true
fiber.wakeup(self.fiber)
end
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment