• Stars
    star
    457
  • Rank 95,775 (Top 2 %)
  • Language
    Rust
  • License
    Mozilla Public Li...
  • Created over 9 years ago
  • Updated almost 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Scalable, coroutine-based, asynchronous IO handling library for Rust programming language. (aka MIO COroutines).

mioco

Travis CI Build Status App Veyor Build Status crates.io Gitter Chat
Documentation

Project status

This is repository for mioco before version 0.9. It's hear for historical reasons, while I've started reworking mioco in the original location: https://github.com/dpc/mioco . Sorry for all the confusion.

Rust community decided that futures should be main Rust async IO story, so you might want to look at tokio-fiber: coroutines as Futures project, which should have mioco-like API and allow easily porting code using mioco.

Code snippet

    mioco::start(|| -> io::Result<()> {
        let addr = listend_addr();

        let listener = try!(TcpListener::bind(&addr));

        println!("Starting tcp echo server on {:?}", try!(listener.local_addr()));

        loop {
            let mut conn = try!(listener.accept());

            mioco::spawn(move || -> io::Result<()> {
                let mut buf = [0u8; 1024 * 16];
                loop {
                    let size = try!(conn.read(&mut buf));
                    if size == 0 {/* eof */ break; }
                    let _ = try!(conn.write_all(&mut buf[0..size]));
                }

                Ok(())
            });
        }
    }).unwrap().unwrap();

This trivial code scales very well. See benchmarks.

Contributors welcome!

Mioco is looking for contributors. See Contributing page for details.

Introduction

Scalable, coroutine-based, asynchronous IO handling library for Rust programming language.

Mioco uses asynchronous event loop, to cooperatively switch between coroutines (aka. green threads), depending on data availability. You can think of mioco as Node.js for Rust or Rust green threads on top of mio.

Read Documentation for details and features.

If you want to say hi, or need help use #mioco gitter.im.

To report a bug or ask for features use github issues.

Building & running

Standalone

To start test echo server:

cargo run --release --example echo

For daily work:

make all

In your project

In Cargo.toml:

[dependencies]
mioco = "*"

In your main.rs:

#[macro_use]
extern crate mioco;

Projects using mioco:

Send PR or drop a link on gitter.

More Repositories

1

rdedup

Data deduplication engine, supporting optional compression and public key encryption.
Rust
829
star
2

breeze

An experimental, kakoune-inspired CLI-centric text/code editor with |-shaped cursor (in Rust)
Rust
202
star
3

rhex

ASCII terminal hexagonal map roguelike written in Rust
Rust
142
star
4

mioco

[no longer maintained] Scalable, coroutine-based, fibers/green-threads for Rust. (aka MIO COroutines).
Rust
141
star
5

rust-bitcoin-indexer

Powerful & versatile Bitcoin Indexer, in Rust
Rust
122
star
6

pariter

Parallel iterator processing library for Rust
Rust
100
star
7

rustyhex

Simple roguelike written in Rust language.
Rust
90
star
8

async-readline

Asynchronous readline-like interface (PoC ATM)
Rust
75
star
9

titanos

Titanos an exercise in writing OS kernel in Rust programming language.
Rust
73
star
10

hex2d-rs

Helper library for working with 2d hex-grid maps
Rust
62
star
11

stpl

Super templates (html, etc.) with plain-Rust; no macros, no textfiles
Rust
37
star
12

sniper

Educational Rust implemenation of Auction Sniper from Growing Object-Oriented Software, Guided By Tests
Rust
36
star
13

tokio-fiber

Async fibers for Rust `futures` and `tokio` using coroutines. Attempt at a `mioco` replacement.
Rust
31
star
14

dotr

Very simple dotfile manager
Rust
26
star
15

text-minimap

Generate text minimap/preview using Braille Patterns
Rust
24
star
16

titanium-draft

Titanium is an exercise in writing OS kernel in Rust programming language.
Rust
24
star
17

overflow-proof

Monadic checked arithmetic for Rust
Rust
23
star
18

boulder-dash.rs

A remake of the classic Boulder Dash game in Rust, using Amethyst.rs engine
Rust
21
star
19

docker-source-checksum

Deterministic source-based docker image checksum
Rust
21
star
20

vim-smarttabs

Vim Smart Tabs
Vim Script
18
star
21

colerr

Colorize stderr
Rust
17
star
22

tagwiki

A wiki in which you link to pages by specifing hashtags they contain.
Rust
16
star
23

htmx-sorta

Rust + htmx + tailwind + nix + redb + twind demo web app
Rust
13
star
24

xmppconsole

Simple readline and libstrophe based CLI XMPP client.
C
12
star
25

rust-bin-template

Rust project template with CI-built releases
Shell
12
star
26

fs-dir-cache

A CLI tool for CIs and build scripts, making file system based caching easy and correct (locking, eviction, etc.)
Rust
11
star
27

atifand.sh

Automatic fan speed control for ATI video cards using catalyst driver under Linux.
Shell
9
star
28

cbuf-rs

Circular Buffer for Rust
Rust
8
star
29

recycle-rs

Simple allocated buffers reuse for Rust
Rust
7
star
30

ttcms

Tiny Trivial CMS (with Markdown)
PHP
7
star
31

mioecho

Rust mio echo server.
Rust
7
star
32

chain-monitor

web-UI based tool to monitor chain heights of various blockchains as reported by different sources
Rust
6
star
33

convi

Convi - convenient (but safe) conversion (From-like) traits for Rust
Rust
5
star
34

hyper-get

curl-like tool/library written in Rust using Hyper
Rust
4
star
35

dpcgoban

Simple and efficient J2ME application for playing Go.
Java
4
star
36

block-iter

Another experiment in Bitcoin indexing
Rust
4
star
37

rclist-rs

Rust library: `RcList` is read-only, append only list (log), that can share common tail (history) with other `RcList`-s.
Rust
4
star
38

node-tcp-echo-server

The simplest node tcp echo server.
JavaScript
3
star
39

brainwiki

Moved to `tagwiki`. A wiki for my brain
Rust
3
star
40

redb-bincode

A wrapper around `redb` that makes it store everything as `bincode`d
Rust
3
star
41

muttmailer

Script for managing mass mailing from the console.
Shell
2
star
42

titanium.rs

A library for writing embeddded (baremetal) software in Rust
Rust
2
star
43

ratelimit-gcra

GCRA rate limit algorithm extracted from `redis-cell`
Rust
2
star
44

rust-default

`use default::default;` for your Rust crate
Rust
2
star
45

dack

Dack is Ack(grep-like tool)-like tool.
D
2
star
46

hex2d-dpcext-rs

dpc's hacky extensions to hex2d-rs library
Rust
2
star
47

boardgametimer

Android Board Game Timer
Java
2
star
48

dedns

Dedns is a public censorship-resistant, tamper-proof, 0-setup identity system.
1
star
49

insideout

Wrap composed types inside-out (library for Rust)
Rust
1
star
50

rust-htmx-template

My simple template web app repo
Rust
1
star
51

todo

My tiny "productivity" system
Nix
1
star
52

flakes

My flake related utilities and templates
Nix
1
star
53

dpc

1
star
54

rdup-du

rdup backup disk usage estimator
Rust
1
star
55

livecd-editor

Simple Makefile based LiveCD .iso editor (for debian/ubuntu)
Makefile
1
star
56

crane-deps-rebuild-repro

You don't want to know
Nix
1
star