Code Monkey home page Code Monkey logo

mqk's Introduction

MQK

简体中文

By google translate

MQK is a simple, high-performance PHP background task framework. MQK simplifies complex message queues to RPC and event handling, eliminating the need for complex queues, tasks, and processes. MQK can handle 20,000 + data per second on a single core VPS, and 6,000 + per second in fault tolerant mode.

Install

composer require mqk/mqk

Dependencies

  • php 5.6
  • redis-server

Usage

  1. The first step is to use the K::invoke method to call the method and pass in the parameter\K::invoke ('\\ MQK\\Test\\Calculator::sum', 1, 2).
\K::invoke('Calculator::sum', 1, 2);
  1. Create class and static methods
class Calculator
{
    public static function sum($a, $b)
    {
        return $a + $b;
    }
}
  1. Start the consumer program. In debug mode, the console outputs the return result of the asynchronous task.
$ vendor/bin/mqk run
[2017-07-11 08:14:52] 14327 .NOTICE: Master work on 14327 [] []
[2017-07-11 08:14:56] 14331 .INFO: Message finished and result is 2 [] []

Development status

Development, is not recommended for use in the production environment.

  • No rigorous testing, there may be a variety of problems.
  • Function parameters in json format serialization, can not use php objects

Documents

It is recommended to use MQK's event mechanism to perform real-time data analysis.

Chinese contents of table

mqk's People

Contributors

fatrellis avatar imcj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  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.