Code Monkey home page Code Monkey logo

kv's Introduction

RoadRunner KV Plugin Bridge

PHP Version Require Latest Stable Version phpunit psalm Total Downloads

Documentation | Framework Bundle

This repository contains the codebase PSR-16 PHP cache bridge using kv RoadRunner plugin.

Installation

To install application server and KV codebase

composer require spiral/roadrunner-kv

You can use the convenient installer to download the latest available compatible version of RoadRunner server:

composer require spiral/roadrunner-cli --dev
vendor/bin/rr get

Usage

First you need to add at least one kv plugin to your roadrunner configuration. For example, such a configuration would be quite feasible to run:

rpc:
  listen: tcp://127.0.0.1:6001

kv:
  test:
    driver: memory
    config:
        interval: 10

Note Read more about all available drivers on the documentation page.

After starting the server with this configuration, one driver named "test" will be available to you.

The following code will allow writing and reading an arbitrary value from the RoadRunner server.

<?php

use Spiral\Goridge\RPC\RPC;
use Spiral\RoadRunner\KeyValue\Factory;

require __DIR__ . '/vendor/autoload.php';

$factory = new Factory(RPC::create('tcp://127.0.0.1:6001'));

$cache = $factory->select('test');

// After that you can write and read arbitrary values:

$cache->set('key', 'value');

echo $cache->get('key'); // string(5) "value"
try Spiral Framework

License:

MIT License (MIT). Please see LICENSE for more information. Maintained by Spiral Scout.

kv's People

Contributors

rustatian avatar serafimarts avatar butschster avatar l3tum avatar msmakouz avatar roxblnfk avatar wolfy-j avatar vvval avatar meekstellar 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.