Code Monkey home page Code Monkey logo

levent's Introduction

levent

levent is a lua concurrency networking library inspired by gevent.

Features include:

  • Fast event loop based on libev.
  • Simple and clean socket library
  • Cooperative dns client by pure lua
  • Similar api and components with gevent but with much more simpler implementation and better performance.

levent is licensed under MIT license.

get levent

Install lua 5.2 or newer.

Clone the repository.

Read test case and examples.

Post feedback and issues on the bug tracker,

build

need cmake 2.8 or newer.

cmake .
make

ways to build on windows, ref to blog

code example

levent's api is clean, below is a code example for how to run a time limit work

lua <<SCRIPT
local levent  = require "levent.levent"
local timeout = require "levent.timeout"

function main()
    print("work 1:", timeout.run(0.2, levent.sleep, 0.1))
    print("work 2:", timeout.run(0.1, levent.sleep, 0.2))
end
levent.start(main)
SCRIPT

running tests

there are some tests and examples under tests and examples to illustrate how to use levent, you can run tests and examples from root folder of levent as below.

lua tests/test_socket.lua
lua examples/dns_mass_resolve.lua

documents

coming soon~~

licence

The MIT License (MIT) Copyright (c) 2014 xjdrew

levent's People

Contributors

xjdrew avatar spin6lock avatar

Watchers

James Cloos avatar xiuzhifu 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.