diff --git a/.dockerignore b/.dockerignore
new file mode 100644
index 00000000..8b897090
--- /dev/null
+++ b/.dockerignore
@@ -0,0 +1,7 @@
+.github
+.vs
+.vscode
+Scripts
+tests
+**/bin
+**/obj
\ No newline at end of file
diff --git a/Dockerfile b/Dockerfile
index 7ef7253a..a705ceee 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,8 +1,16 @@
-FROM progaudi/dotnet:1.0.1-xenial
+FROM microsoft/dotnet:2.1-sdk as sdk
WORKDIR /app
-ENV PATH $PATH:/root/.dotnet
# copy csproj and restore as distinct layers
COPY . .
-RUN /app/scripts/build-netcore.sh
\ No newline at end of file
+RUN dotnet build -c Release progaudi.tarantool.sln
+RUN dotnet msbuild /t:publish /p:NoBuild=True /p:Configuration=Release samples/insert-performance/insert-performance.csproj
+
+FROM microsoft/dotnet:2.1-runtime as runtime
+
+WORKDIR /app
+
+COPY --from=sdk /app/samples/insert-performance/bin/Release/netcoreapp2.1/publish .
+
+CMD ["dotnet", "insert-performance.dll"]
diff --git a/Dockerfile.alpine b/Dockerfile.alpine
new file mode 100644
index 00000000..4a5340e0
--- /dev/null
+++ b/Dockerfile.alpine
@@ -0,0 +1,16 @@
+FROM microsoft/dotnet:2.1-sdk-alpine as sdk
+
+WORKDIR /app
+
+# copy csproj and restore as distinct layers
+COPY . .
+RUN dotnet build -c Release progaudi.tarantool.sln
+RUN dotnet msbuild /t:publish /p:NoBuild=True /p:Configuration=Release samples/insert-performance/insert-performance.csproj
+
+FROM microsoft/dotnet:2.1-runtime-alpine as runtime
+
+WORKDIR /app
+
+COPY --from=sdk /app/samples/insert-performance/bin/Release/netcoreapp2.1/publish .
+
+CMD ["dotnet", "insert-performance.dll"]
diff --git a/Scripts/run-insert-benchmark.sh b/Scripts/run-insert-benchmark.sh
new file mode 100644
index 00000000..3f8de007
--- /dev/null
+++ b/Scripts/run-insert-benchmark.sh
@@ -0,0 +1,16 @@
+#!/usr/bin/env bash
+
+set -evx
+
+pushd ${BASH_SOURCE%/*}/..
+
+docker-compose down && docker-compose up -d
+
+./Scripts/build-netcore.sh
+
+pushd samples/insert-performance/bin/Release/netcoreapp2.0/
+
+dotnet insert-performance.dll
+
+popd
+popd
\ No newline at end of file
diff --git a/docker-compose.yml b/docker-compose.yml
index 9f227fde..681056de 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -1,40 +1,60 @@
version: '3.2'
services:
- tarantool_1_7:
- image: progaudi/tarantool:1.7.5-184-g5be3a82be # same version as tarantool in homebrew on mac os
- command: tarantool /usr/local/share/tarantool/tarantool.docker.lua
- volumes:
- - $PWD/tarantool:/usr/local/share/tarantool
- ports:
- - "3301:3301"
- environment:
- TARANTOOL_USER_NAME: admin
- TARANTOOL_USER_PASSWORD: adminPassword
- TARANTOOL_SLAB_ALLOC_ARENA: 0.1
+ # tarantool_1_7:
+ # image: progaudi/tarantool:1.7.5-184-g5be3a82be # same version as tarantool in homebrew on mac os
+ # command: tarantool /usr/local/share/tarantool/tarantool.docker.lua
+ # volumes:
+ # - $PWD/tarantool:/usr/local/share/tarantool
+ # ports:
+ # - "3301:3301"
+ # environment:
+ # TARANTOOL_USER_NAME: admin
+ # TARANTOOL_USER_PASSWORD: adminPassword
+ # TARANTOOL_SLAB_ALLOC_ARENA: 2
tarantool_1_8:
- image: progaudi/tarantool:1.8.2-288-g99128d7d3
+ image: progaudi/tarantool:1.9.0-47-gfabbcfa68
command: tarantool /usr/local/share/tarantool/tarantool.docker.lua
volumes:
- $PWD/tarantool:/usr/local/share/tarantool
ports:
- - "3302:3301"
+ - "3301:3301"
environment:
TARANTOOL_USER_NAME: admin
TARANTOOL_USER_PASSWORD: adminPassword
- TARANTOOL_SLAB_ALLOC_ARENA: 0.1
+ TARANTOOL_SLAB_ALLOC_ARENA: 2
- redis:
- image: redis:3.0-alpine
- command: redis-server
- ports:
- - 6379:6379
+ # redis:
+ # image: redis:3.0-alpine
+ # command: redis-server
+ # ports:
+ # - 6379:6379
- admin:
- image: quay.io/basis-company/tarantool-admin
- ports:
- - 8888:80
+ # admin:
+ # image: quay.io/basis-company/tarantool-admin
+ # ports:
+ # - 8888:80
+ # depends_on:
+ # - tarantool_1_7
+ # - tarantool_1_8
+
+ go:
+ build:
+ context: samples/go-insert
+ depends_on:
+ - tarantool_1_8
+
+ net-alpine:
+ build:
+ context: .
+ dockerfile: Dockerfile.alpine
+ depends_on:
+ - tarantool_1_8
+
+ net:
+ build:
+ context: .
+ dockerfile: Dockerfile
depends_on:
- - tarantool_1_7
- tarantool_1_8
diff --git a/global.json b/global.json
index 4d61027a..d65e3d5d 100644
--- a/global.json
+++ b/global.json
@@ -1,5 +1,5 @@
{
"sdk": {
- "version": "2.0.0"
+ "version": "2.1.300"
}
-}
\ No newline at end of file
+}
diff --git a/progaudi.tarantool.sln b/progaudi.tarantool.sln
index 1916e0c7..e33c0bd9 100644
--- a/progaudi.tarantool.sln
+++ b/progaudi.tarantool.sln
@@ -5,14 +5,14 @@ VisualStudioVersion = 15.0.26730.12
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "progaudi.tarantool", "src\progaudi.tarantool\progaudi.tarantool.csproj", "{DD007E9F-FB2D-4351-AAB7-F2D367B295C4}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "progaudi.tarantool.tests", "tests\progaudi.tarantool.tests\progaudi.tarantool.tests.csproj", "{4C681801-9A6B-4CE9-8EAA-23F80917F046}"
-EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{14BAEDF1-BEFC-4FB2-AAC9-08D397191216}"
ProjectSection(SolutionItems) = preProject
global.json = global.json
EndProjectSection
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "progaudi.tarantool.benchmark", "src\progaudi.tarantool.benchmark\progaudi.tarantool.benchmark.csproj", "{CD96AC2D-505F-4FDF-82FB-76F51CC28FF4}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "insert-performance", "samples\insert-performance\insert-performance.csproj", "{9A42ABC2-AA01-4A89-9DBF-ACBBC7E0F461}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "tests", "src\tests\tests.csproj", "{1B3E430D-A1DE-4650-8E4A-1D8B62ECE584}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -36,30 +36,30 @@ Global
{DD007E9F-FB2D-4351-AAB7-F2D367B295C4}.Release|x64.Build.0 = Release|Any CPU
{DD007E9F-FB2D-4351-AAB7-F2D367B295C4}.Release|x86.ActiveCfg = Release|Any CPU
{DD007E9F-FB2D-4351-AAB7-F2D367B295C4}.Release|x86.Build.0 = Release|Any CPU
- {4C681801-9A6B-4CE9-8EAA-23F80917F046}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {4C681801-9A6B-4CE9-8EAA-23F80917F046}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {4C681801-9A6B-4CE9-8EAA-23F80917F046}.Debug|x64.ActiveCfg = Debug|Any CPU
- {4C681801-9A6B-4CE9-8EAA-23F80917F046}.Debug|x64.Build.0 = Debug|Any CPU
- {4C681801-9A6B-4CE9-8EAA-23F80917F046}.Debug|x86.ActiveCfg = Debug|Any CPU
- {4C681801-9A6B-4CE9-8EAA-23F80917F046}.Debug|x86.Build.0 = Debug|Any CPU
- {4C681801-9A6B-4CE9-8EAA-23F80917F046}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {4C681801-9A6B-4CE9-8EAA-23F80917F046}.Release|Any CPU.Build.0 = Release|Any CPU
- {4C681801-9A6B-4CE9-8EAA-23F80917F046}.Release|x64.ActiveCfg = Release|Any CPU
- {4C681801-9A6B-4CE9-8EAA-23F80917F046}.Release|x64.Build.0 = Release|Any CPU
- {4C681801-9A6B-4CE9-8EAA-23F80917F046}.Release|x86.ActiveCfg = Release|Any CPU
- {4C681801-9A6B-4CE9-8EAA-23F80917F046}.Release|x86.Build.0 = Release|Any CPU
- {CD96AC2D-505F-4FDF-82FB-76F51CC28FF4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {CD96AC2D-505F-4FDF-82FB-76F51CC28FF4}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {CD96AC2D-505F-4FDF-82FB-76F51CC28FF4}.Debug|x64.ActiveCfg = Debug|Any CPU
- {CD96AC2D-505F-4FDF-82FB-76F51CC28FF4}.Debug|x64.Build.0 = Debug|Any CPU
- {CD96AC2D-505F-4FDF-82FB-76F51CC28FF4}.Debug|x86.ActiveCfg = Debug|Any CPU
- {CD96AC2D-505F-4FDF-82FB-76F51CC28FF4}.Debug|x86.Build.0 = Debug|Any CPU
- {CD96AC2D-505F-4FDF-82FB-76F51CC28FF4}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {CD96AC2D-505F-4FDF-82FB-76F51CC28FF4}.Release|Any CPU.Build.0 = Release|Any CPU
- {CD96AC2D-505F-4FDF-82FB-76F51CC28FF4}.Release|x64.ActiveCfg = Release|Any CPU
- {CD96AC2D-505F-4FDF-82FB-76F51CC28FF4}.Release|x64.Build.0 = Release|Any CPU
- {CD96AC2D-505F-4FDF-82FB-76F51CC28FF4}.Release|x86.ActiveCfg = Release|Any CPU
- {CD96AC2D-505F-4FDF-82FB-76F51CC28FF4}.Release|x86.Build.0 = Release|Any CPU
+ {9A42ABC2-AA01-4A89-9DBF-ACBBC7E0F461}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {9A42ABC2-AA01-4A89-9DBF-ACBBC7E0F461}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {9A42ABC2-AA01-4A89-9DBF-ACBBC7E0F461}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {9A42ABC2-AA01-4A89-9DBF-ACBBC7E0F461}.Debug|x64.Build.0 = Debug|Any CPU
+ {9A42ABC2-AA01-4A89-9DBF-ACBBC7E0F461}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {9A42ABC2-AA01-4A89-9DBF-ACBBC7E0F461}.Debug|x86.Build.0 = Debug|Any CPU
+ {9A42ABC2-AA01-4A89-9DBF-ACBBC7E0F461}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {9A42ABC2-AA01-4A89-9DBF-ACBBC7E0F461}.Release|Any CPU.Build.0 = Release|Any CPU
+ {9A42ABC2-AA01-4A89-9DBF-ACBBC7E0F461}.Release|x64.ActiveCfg = Release|Any CPU
+ {9A42ABC2-AA01-4A89-9DBF-ACBBC7E0F461}.Release|x64.Build.0 = Release|Any CPU
+ {9A42ABC2-AA01-4A89-9DBF-ACBBC7E0F461}.Release|x86.ActiveCfg = Release|Any CPU
+ {9A42ABC2-AA01-4A89-9DBF-ACBBC7E0F461}.Release|x86.Build.0 = Release|Any CPU
+ {1B3E430D-A1DE-4650-8E4A-1D8B62ECE584}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {1B3E430D-A1DE-4650-8E4A-1D8B62ECE584}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {1B3E430D-A1DE-4650-8E4A-1D8B62ECE584}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {1B3E430D-A1DE-4650-8E4A-1D8B62ECE584}.Debug|x64.Build.0 = Debug|Any CPU
+ {1B3E430D-A1DE-4650-8E4A-1D8B62ECE584}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {1B3E430D-A1DE-4650-8E4A-1D8B62ECE584}.Debug|x86.Build.0 = Debug|Any CPU
+ {1B3E430D-A1DE-4650-8E4A-1D8B62ECE584}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {1B3E430D-A1DE-4650-8E4A-1D8B62ECE584}.Release|Any CPU.Build.0 = Release|Any CPU
+ {1B3E430D-A1DE-4650-8E4A-1D8B62ECE584}.Release|x64.ActiveCfg = Release|Any CPU
+ {1B3E430D-A1DE-4650-8E4A-1D8B62ECE584}.Release|x64.Build.0 = Release|Any CPU
+ {1B3E430D-A1DE-4650-8E4A-1D8B62ECE584}.Release|x86.ActiveCfg = Release|Any CPU
+ {1B3E430D-A1DE-4650-8E4A-1D8B62ECE584}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/samples/go-insert/Dockerfile b/samples/go-insert/Dockerfile
new file mode 100644
index 00000000..a3e91f95
--- /dev/null
+++ b/samples/go-insert/Dockerfile
@@ -0,0 +1,9 @@
+FROM golang
+
+WORKDIR /go/src/app
+COPY . .
+
+RUN go get -d -v ./...
+RUN go install -v ./...
+
+CMD ["app"]
\ No newline at end of file
diff --git a/samples/go-insert/app.go b/samples/go-insert/app.go
new file mode 100644
index 00000000..bb7eceb9
--- /dev/null
+++ b/samples/go-insert/app.go
@@ -0,0 +1,33 @@
+package main
+
+import (
+ "fmt"
+ "log"
+ "time"
+
+ "github.com/tarantool/go-tarantool"
+)
+
+func main() {
+ opts := tarantool.Opts{}
+ conn, err := tarantool.Connect("tarantool_1_8:3301", opts)
+
+ // conn, err := tarantool.Connect("/path/to/tarantool.socket", opts)
+ if err != nil {
+ fmt.Println("Connection refused: %s", err.Error())
+ }
+ start := time.Now()
+ f := make([]*tarantool.Future, 0)
+ for i := 0; i < 1000000; i++ {
+ fut := conn.InsertAsync("pivot", []interface{}{i, []int{i, i}, i})
+ f = append(f, fut)
+ }
+ for _, element := range f {
+ _, err := element.Get()
+ if err != nil {
+ fmt.Println("Insert failed: %s", err.Error())
+ }
+ }
+ elapsed := time.Since(start)
+ log.Printf("Insert took %s", elapsed)
+}
diff --git a/samples/insert-performance/Program.cs b/samples/insert-performance/Program.cs
new file mode 100644
index 00000000..bc2d0b42
--- /dev/null
+++ b/samples/insert-performance/Program.cs
@@ -0,0 +1,60 @@
+using System;
+using System.Diagnostics;
+using System.Runtime.InteropServices;
+using System.Threading.Tasks;
+using ProGaudi.Tarantool.Client;
+using ProGaudi.Tarantool.Client.Model;
+
+namespace Tarantool.Test
+{
+ class Program
+ {
+ static void Main()
+ {
+ var log = new TextWriterLog(Console.Out);
+ var options = new ClientOptions(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "localhost:3301" : "tarantool_1_8:3301");
+ //var options = new ClientOptions(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "localhost:3301" : "tarantool_1_8:3301", log);
+ var sw = new Stopwatch();
+ try
+ {
+ using (var box = new Box(options))
+ {
+ box.Connect().GetAwaiter().GetResult();
+ box.Schema.TryGetSpace<(int, (int, int), int)>("pivot", out var space);
+ var lst = new Task[1000];
+ sw.Start();
+ for (var i = 0; i < 1_000_000; i++)
+ {
+ lst[i % 1000] = space.Insert((i, (i, i), i));
+
+ if (i % 1000 == 999)
+ {
+ Task.WaitAll(lst);
+ //return;
+ }
+
+ if (i % 10000 == 9999)
+ {
+ Console.Write("*");
+ if (i % 100000 == 99999)
+ {
+ Console.WriteLine();
+ }
+ }
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ Console.WriteLine(e);
+ }
+ finally
+ {
+ sw.Stop();
+
+ Console.WriteLine();
+ Console.WriteLine(sw.ElapsedMilliseconds);
+ }
+ }
+ }
+}
diff --git a/samples/insert-performance/insert-performance.csproj b/samples/insert-performance/insert-performance.csproj
new file mode 100644
index 00000000..77f3daa8
--- /dev/null
+++ b/samples/insert-performance/insert-performance.csproj
@@ -0,0 +1,19 @@
+
+
+
+ Exe
+ netcoreapp2.1
+
+
+
+ 7.2
+
+
+
+ 7.2
+
+
+
+
+
+
diff --git a/src/progaudi.tarantool.benchmark/IncrementBenchmark.cs b/src/progaudi.tarantool.benchmark/IncrementBenchmark.cs
index f92336a7..597a2fb6 100644
--- a/src/progaudi.tarantool.benchmark/IncrementBenchmark.cs
+++ b/src/progaudi.tarantool.benchmark/IncrementBenchmark.cs
@@ -22,6 +22,6 @@ public IncrementBenchmark()
public async Task Redis() => await _redis.StringIncrementAsync("test_for_benchmarking");
[Benchmark]
- public async Task> Tarantool() => await _box.Call("test_for_benchmarking");
+ public async Task> Tarantool() => await _box.Call("test_for_benchmarking", 0);
}
}
\ No newline at end of file
diff --git a/src/progaudi.tarantool.benchmark/progaudi.tarantool.benchmark.csproj b/src/progaudi.tarantool.benchmark/progaudi.tarantool.benchmark.csproj
index 442f3c89..19657efc 100644
--- a/src/progaudi.tarantool.benchmark/progaudi.tarantool.benchmark.csproj
+++ b/src/progaudi.tarantool.benchmark/progaudi.tarantool.benchmark.csproj
@@ -1,10 +1,18 @@
-
+
Exe
- netcoreapp1.1;netcoreapp2.0
+ netcoreapp2.0
+ latest
+
+ 4
true
+ progaudi.tarantool
+ ProGaudi.Tarantool.Client
+ progaudi.tarantool
+ Copyright © 2016-2018
+
progaudi.tarantool.benchmark
ProGaudi.Tarantool.Benchmark
diff --git a/src/progaudi.tarantool/AwaitableSocket.cs b/src/progaudi.tarantool/AwaitableSocket.cs
new file mode 100644
index 00000000..b10c986b
--- /dev/null
+++ b/src/progaudi.tarantool/AwaitableSocket.cs
@@ -0,0 +1,131 @@
+using System;
+using System.Net.Sockets;
+using System.Runtime.CompilerServices;
+using System.Threading;
+using System.Threading.Tasks;
+
+// ReSharper disable once CheckNamespace
+namespace Npgsql
+{
+ public sealed class AwaitableSocket : INotifyCompletion, IDisposable
+ {
+ private static readonly Action Sentinel = () => { };
+
+ private readonly SocketAsyncEventArgs _socketAsyncEventArgs;
+ private readonly Socket _socket;
+
+ private Action _continuation;
+
+ public AwaitableSocket(SocketAsyncEventArgs socketAsyncEventArgs, Socket socket)
+ {
+ _socketAsyncEventArgs = socketAsyncEventArgs;
+ _socket = socket;
+
+ socketAsyncEventArgs.Completed
+ += (_, __) =>
+ {
+ var continuation
+ = _continuation
+ ?? Interlocked.CompareExchange(ref _continuation, Sentinel, null);
+
+ continuation?.Invoke();
+ };
+ }
+
+ public bool IsConnected => _socket.Connected;
+ public int BytesTransferred => _socketAsyncEventArgs.BytesTransferred;
+
+ public AwaitableSocket ConnectAsync(CancellationToken cancellationToken)
+ {
+ Reset();
+
+ if (!_socket.ConnectAsync(_socketAsyncEventArgs))
+ {
+ IsCompleted = true;
+ }
+
+ cancellationToken.Register(Cancel);
+
+ void Cancel()
+ {
+ if (!_socket.Connected)
+ {
+ _socket.Dispose();
+ }
+ }
+
+ return this;
+ }
+
+ public AwaitableSocket ReceiveAsync()
+ {
+ Reset();
+
+ if (!_socket.ReceiveAsync(_socketAsyncEventArgs))
+ {
+ IsCompleted = true;
+ }
+
+ return this;
+ }
+
+ public AwaitableSocket SendAsync()
+ {
+ Reset();
+
+ if (!_socket.SendAsync(_socketAsyncEventArgs))
+ {
+ IsCompleted = true;
+ }
+
+ return this;
+ }
+
+ private void Reset()
+ {
+ IsCompleted = false;
+ _continuation = null;
+ }
+
+ public AwaitableSocket GetAwaiter()
+ {
+ return this;
+ }
+
+ public bool IsCompleted { get; private set; }
+
+ public void OnCompleted(Action continuation)
+ {
+ if (_continuation == Sentinel
+ || Interlocked.CompareExchange(
+ ref _continuation, continuation, null) == Sentinel)
+ {
+ Task.Run(continuation);
+ }
+ }
+
+ public void GetResult()
+ {
+ if (_socketAsyncEventArgs.SocketError != SocketError.Success)
+ {
+ throw new SocketException((int)_socketAsyncEventArgs.SocketError);
+ }
+ }
+
+ public void Dispose()
+ {
+ if (_socket != null)
+ {
+ if (_socket.Connected)
+ {
+ _socket.Shutdown(SocketShutdown.Both);
+ _socket.Close();
+ }
+
+ _socket.Dispose();
+ }
+
+ _socketAsyncEventArgs?.Dispose();
+ }
+ }
+}
diff --git a/src/progaudi.tarantool/Box.cs b/src/progaudi.tarantool/Box.cs
index 21b892bf..0b329e8f 100644
--- a/src/progaudi.tarantool/Box.cs
+++ b/src/progaudi.tarantool/Box.cs
@@ -1,8 +1,8 @@
-using System.Collections.Generic;
+using System;
+using System.Collections.Generic;
using System.Threading.Tasks;
+using ProGaudi.MsgPack.Light;
using ProGaudi.Tarantool.Client.Model;
-using ProGaudi.Tarantool.Client.Model.Requests;
-using ProGaudi.Tarantool.Client.Model.Responses;
using ProGaudi.Tarantool.Client.Utils;
namespace ProGaudi.Tarantool.Client
@@ -22,7 +22,7 @@ public Box(ClientOptions options)
_clientOptions = options;
TarantoolConvertersRegistrator.Register(options.MsgPackContext);
- _logicalConnection = new LogicalConnectionManager(options);
+ _logicalConnection = new LogicalConnection(options, new RequestIdCounter());
Metrics = new Metrics(_logicalConnection);
Schema = new Schema(_logicalConnection);
}
@@ -33,6 +33,16 @@ public Box(ClientOptions options)
public ISchema Schema { get; }
+ public ILuaCode GetLuaFunc(string name)
+ {
+ throw new NotImplementedException();
+ }
+
+ public ILuaCode GetLuaCode(string code)
+ {
+ throw new NotImplementedException();
+ }
+
public BoxInfo Info
{
get => _info;
@@ -58,11 +68,12 @@ IEnumerable GetAdditionalTasks()
}
}
- public async Task ReloadBoxInfo()
+ public Task ReloadBoxInfo()
{
- var report = await Eval("return box.info").ConfigureAwait(false);
- if (report.Data.Length != 1) throw ExceptionHelper.CantParseBoxInfoResponse();
- Info = report.Data[0];
+ //var report = await Eval("return box.info").ConfigureAwait(false);
+ //if (report.Data.Length != 1) throw ExceptionHelper.CantParseBoxInfoResponse();
+ //Info = report.Data[0];
+ throw new NotImplementedException();
}
public static async Task Connect(string replicationSource)
@@ -97,71 +108,30 @@ public Task ReloadSchema()
return Schema.Reload();
}
- public async Task Call_1_6(string functionName)
- {
- await Call_1_6(functionName, TarantoolTuple.Empty).ConfigureAwait(false);
- }
-
- public async Task Call_1_6(string functionName, TTuple parameters)
- {
- await Call_1_6(functionName, parameters).ConfigureAwait(false);
- }
-
- public Task> Call_1_6(string functionName)
- {
- return Call_1_6(functionName, TarantoolTuple.Empty);
- }
-
- public async Task> Call_1_6(string functionName, TTuple parameters)
- {
- var callRequest = new CallRequest(functionName, parameters, false);
- return await _logicalConnection.SendRequest, TResponse>(callRequest).ConfigureAwait(false);
- }
-
- public async Task Call(string functionName)
- {
- await Call(functionName, TarantoolTuple.Empty).ConfigureAwait(false);
- }
-
- public async Task Call(string functionName, TTuple parameters)
- {
- await Call(functionName, parameters).ConfigureAwait(false);
- }
-
- public Task> Call(string functionName)
- {
- return Call(functionName, TarantoolTuple.Empty);
- }
-
- public async Task> Call(string functionName, TTuple parameters)
+ public Task> Call(string functionName, TTuple parameters)
{
var callRequest = new CallRequest(functionName, parameters);
- return await _logicalConnection.SendRequest, TResponse>(callRequest).ConfigureAwait(false);
+ return _logicalConnection.SendRequest, TResponse>(callRequest);
}
- public async Task> Eval(string expression, TTuple parameters)
+ public Task> Eval(string expression, TTuple parameters)
{
var evalRequest = new EvalRequest(expression, parameters);
- return await _logicalConnection.SendRequest, TResponse>(evalRequest).ConfigureAwait(false);
- }
-
- public Task> Eval(string expression)
- {
- return Eval(expression, TarantoolTuple.Empty);
+ return _logicalConnection.SendRequest, TResponse>(evalRequest);
}
- public Task ExecuteSql(string query, params SqlParameter[] parameters)
- {
- if (!_sqlReady) throw ExceptionHelper.SqlIsNotAvailable(Info.Version);
+ //public Task ExecuteSql(string query, params SqlParameter[] parameters)
+ //{
+ // if (!_sqlReady) throw ExceptionHelper.SqlIsNotAvailable(Info.Version);
- return _logicalConnection.SendRequest(new ExecuteSqlRequest(query, parameters));
- }
+ // return _logicalConnection.SendRequest(new ExecuteSqlRequest(query, parameters));
+ //}
- public Task> ExecuteSql(string query, params SqlParameter[] parameters)
- {
- if (!_sqlReady) throw ExceptionHelper.SqlIsNotAvailable(Info.Version);
+ //public Task> ExecuteSql(string query, params SqlParameter[] parameters)
+ //{
+ // if (!_sqlReady) throw ExceptionHelper.SqlIsNotAvailable(Info.Version);
- return _logicalConnection.SendRequest(new ExecuteSqlRequest(query, parameters));
- }
+ // return _logicalConnection.SendRequest(new ExecuteSqlRequest(query, parameters));
+ //}
}
}
\ No newline at end of file
diff --git a/src/progaudi.tarantool/Converters/AuthenticationPacketConverter.cs b/src/progaudi.tarantool/Converters/AuthenticationPacketConverter.cs
deleted file mode 100644
index f7823097..00000000
--- a/src/progaudi.tarantool/Converters/AuthenticationPacketConverter.cs
+++ /dev/null
@@ -1,50 +0,0 @@
-using System;
-
-using ProGaudi.MsgPack.Light;
-
-using ProGaudi.Tarantool.Client.Model.Enums;
-using ProGaudi.Tarantool.Client.Model.Requests;
-
-namespace ProGaudi.Tarantool.Client.Converters
-{
- internal class AuthenticationPacketConverter : IMsgPackConverter
- {
- private IMsgPackConverter _keyConverter;
- private IMsgPackConverter _bytesConverter;
- private IMsgPackConverter _stringConverter;
- private IMsgPackConverter