Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
picodata
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
core
picodata
Merge requests
!68
Bump tarantool-module
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Bump tarantool-module
stored-proc-macro
into
master
Overview
0
Commits
1
Pipelines
1
Changes
2
Merged
Yaroslav Dynnikov
requested to merge
stored-proc-macro
into
master
3 years ago
Overview
0
Commits
1
Pipelines
1
Changes
2
Expand
Also, use brand new
tarantool::proc
macro for stored procedures.
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
b9e278c6
1 commit,
3 years ago
2 files
+
7
−
23
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
src/main.rs
+
6
−
22
Options
use
error
::
CoercionError
;
use
nix
::
sys
::
signal
::{
self
,
Signal
};
use
nix
::
unistd
::
Pid
;
use
std
::
os
::
raw
::{
c_char
,
c_int
,
c_void
};
@@ -5,10 +6,8 @@ use std::process::Stdio;
use
structopt
::
StructOpt
;
use
::
raft
::
prelude
as
raft
;
use
::
tarantool
::
error
::
TarantoolErrorCode
::
ProcC
as
ProcCError
;
use
::
tarantool
::
set_error
;
use
::
tarantool
::
proc
;
use
::
tarantool
::
tlua
;
use
::
tarantool
::
tuple
::{
FunctionArgs
,
FunctionCtx
,
Tuple
};
use
indoc
::
indoc
;
use
message
::
Message
;
use
std
::
convert
::
TryFrom
;
@@ -207,25 +206,10 @@ fn init_handlers() {
);
}
#[no_mangle]
pub
extern
"C"
fn
raft_interact
(
_
:
FunctionCtx
,
args
:
FunctionArgs
)
->
c_int
{
let
raft_node
=
node
();
// Conversion pipeline:
// FunctionArgs -> Tuple -?-> traft::row::Message -?-> raft::Message;
let
m
:
traft
::
row
::
Message
=
match
Tuple
::
from
(
args
)
.into_struct
()
{
Ok
(
v
)
=>
v
,
Err
(
e
)
=>
return
set_error!
(
ProcCError
,
"{e}"
),
};
let
m
=
match
raft
::
Message
::
try_from
(
m
)
{
Ok
(
v
)
=>
v
,
Err
(
e
)
=>
return
set_error!
(
ProcCError
,
"{e}"
),
};
raft_node
.step
(
m
);
0
#[proc(packed_args)]
fn
raft_interact
(
msg
:
traft
::
row
::
Message
)
->
Result
<
(),
CoercionError
>
{
node
()
.step
(
raft
::
Message
::
try_from
(
msg
)
?
);
Ok
(())
}
fn
rm_tarantool_files
(
data_dir
:
&
str
)
{
Loading