Giter Site home page Giter Site logo

riak.driver.net's Introduction

riak.driver.net

Riak.Driver.Net

<?xml version="1.0" encoding="utf-8" ?>
<configuration>

  <configSections>
    <section name="riak"
             type="Riak.Driver.Config.RiakConfigSection, Riak.Driver"/>
  </configSections>

  <riak>
    <client>
      <endpoint name="riak1"
                socketBufferSize="8192"
                messageBufferSize="8192"
                millisecondsSendTimeout="3000"
                millisecondsReceiveTimeout="3000"
                maxConnectionPoolSize="30">
        <servers>
          <!--put you server here-->
          <server host="10.0.20.70" port="8087" />
          <server host="10.0.20.71" port="8087" />
          <server host="10.0.20.72" port="8087" />
        </servers>
      </endpoint>
    </client>
  </riak>

</configuration>
static void Main(string[] args)
{
    System.Threading.ThreadPool.SetMinThreads(30, 30);
    Sodao.FastSocket.SocketBase.Log.Trace.EnableConsole();

    var riakClient = Riak.Driver.RiakClientPool.Get("riak.config", "riak1");

    riakClient.Put(new Riak.Driver.RiakObject("bucket1", "key1", "value1"), options => options.SetW(1).SetReturnBody(true)).ContinueWith(c =>
    {
        if (c.IsFaulted) Console.WriteLine(c.Exception.ToString());
        else Console.WriteLine(c.Result.Value.GetString());
    });

    riakClient.Get("bucket1", new string[] { "key1", "key2" }, options => options.SetR(1)).ContinueWith(c =>
    {
        if (c.IsFaulted) Console.WriteLine(c.Exception.ToString());
        else Console.WriteLine(c.Result.Length);
    });
    Console.ReadLine();
}

riak.driver.net's People

Contributors

ihaoqihao avatar

Watchers

James Cloos avatar penwel avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.