• Stars
    star
    216
  • Rank 183,179 (Top 4 %)
  • Language
    Rust
  • License
    Apache License 2.0
  • Created about 5 years ago
  • Updated about 1 year ago

Reviews

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

Repository Details

A minimalistic async/await executor for Rust

executor

docs.rs docs

[dependencies]
executor = "0.8"

Features

  • #![no_std] + alloc
  • simple enough to learn from! (~ 100 lines)
  • works with WebAssembly

WebAssembly

use web::*;

#[no_mangle]
fn main() {
    executor::run(async {
        loop {
            set_inner_html(DOM_BODY, "⏰ tic");
            sleep(1000).await;
            set_inner_html(DOM_BODY, "⏰ tock");
            sleep(1000).await;
        }
    });
}

See this working here.

CLI

Even async-std can be used if you add something to stop it from exiting too early.

use async_std::task::sleep;
use std::time::Duration;

fn main() {
    let complete = std::sync::Arc::new(core::sync::atomic::AtomicBool::new(false));
    let ender = complete.clone();
    executor::run(async move {
        println!("hello");
        sleep(Duration::from_secs(1)).await;
        println!("world!");
        ender.store(true, core::sync::atomic::Ordering::Release);
    });
    while !complete.load(core::sync::atomic::Ordering::Acquire) {}
}

License

This project is licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in executor by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

More Repositories

1

tour_of_rust

A tour of rust's language features
JavaScript
875
star
2

wasm-service

HTMX, WebAssembly, Rust, ServiceWorkers
Rust
684
star
3

web.rs

JavaScript-WebAssembly interop library for Rust.
Rust
170
star
4

view

a macro for constructing views in Rust πŸ—οΈ
Rust
104
star
5

wasm-module

A web component for running web assembly
JavaScript
77
star
6

watson

a minimilistic web assembly parser, compiler, and interpreter for Rust
Rust
77
star
7

hyperpixel

An extremely fast pixel framebuffer for Rust web assembly 🧱
Rust
62
star
8

rust-roguelike

A simple rust roguelike experiment using web assembly
Rust
55
star
9

webcomponent

A web component library for rust
Rust
55
star
10

pinephone-gtk-rs-starter

Rust
54
star
11

ImageStorage.js

A simple library for using PNG images as key value pair data holders. MIT LICENSE
JavaScript
52
star
12

mars

A data science notebook for Rust
JavaScript
41
star
13

cyberdeck

A library for easily creating WebRTC data channel connections in Rust
Rust
41
star
14

kimono

A terminal style toolkit inspired by CSS for elegant TUIs πŸ‘˜
Rust
40
star
15

mux.js

A data multiplexing library for javascript. MIT LICENSE
JavaScript
37
star
16

shibari.js

Beautiful bindings and nothing else
JavaScript
37
star
17

conifer

Rust
37
star
18

js_ffi

Dynamically invoke javascript from web assembly
Rust
36
star
19

voir

A simple router for lit-html
JavaScript
34
star
20

webblock

The simplest way to make expressive and powerful web components
JavaScript
30
star
21

wasm-script

Compile WebAssembly in your HTML
JavaScript
30
star
22

lit-html-rs

lit-html in Rust
Rust
30
star
23

babylon.rs

A WebAssembly wrapper for babylon.js in Rust
Rust
29
star
24

ukiyoe

A Rust library for rendering images to terminals
Rust
28
star
25

aframe-canvas

A library for adding canvas into aframe VR
JavaScript
28
star
26

epistemology

A simple and clear way of hosting llama.cpp as a private HTTP API using Rust
Rust
26
star
27

aframe-webvr-controller

A component for quickly attaching objects to webvr controllers in a-frame
JavaScript
24
star
28

rust-webcomponent

A simple web component implementation using stdweb
JavaScript
24
star
29

leptos_three

A prototype of creating a React Three Fiber like experience with Leptos and ThreeJS
Rust
24
star
30

gestured

A simple gesture daemon in Rust
Rust
23
star
31

aframe-html

A aframe component for rendering and interacting with html in VR
JavaScript
22
star
32

aws-lambda-api-rust

A sample project for showing how to create an aws lambda api with rust and terraform
Rust
21
star
33

avatar-poser

an avatar animation builder for the metaverse
TypeScript
20
star
34

gbnf

A library for working with GBNF files
Rust
19
star
35

no_error

A simple error library for no_std + no_alloc Rust
Rust
18
star
36

pig

A simple PostgreSQL data migration tool
Rust
18
star
37

c-to-webassembly

Using clang and llvm to compile C into Web Assembly
C
17
star
38

slamburger

A SLAM algorithm for WebAssembly πŸ”
Rust
17
star
39

spark_delta_lake

Python
16
star
40

pinephone-cairo-game-starter

Example of a game for PinePhone using Cairo
Rust
16
star
41

webcompose

Create web components with functional composition
JavaScript
16
star
42

rust-simple-virtual-dom

A very simple virtual dom implementation in Rust and Web Assembly
Rust
16
star
43

woke

A minimalist waker for async-await executors
Rust
15
star
44

staticflux

JavaScript
15
star
45

vala-web-assembly

proof of concept of vala and web assembly
C
15
star
46

lets-build-wasm-interpreter

Let's build a web assembly interpreter!
HTML
15
star
47

llvm-wasm

The most minimal wasm llvm project
HTML
15
star
48

mochi

A simple game engine using Gtk & Cairo
Rust
14
star
49

virtual-dom-rs-counter

Implementation of react/redux style UI development in Rust
Rust
14
star
50

http-server

A dead simple http server for serving local files for development purposes
Rust
13
star
51

globals

Painless globals in Rust πŸ”­πŸŒβœ¨
Rust
12
star
52

legacy_wabisabi

A modular web assembly microkernel os for the web
JavaScript
12
star
53

rxjs-pubsub

Simple publish-subscription data structure using rxjs
JavaScript
11
star
54

libw

A human library for easily using wasi
Rust
11
star
55

asynctimer

A minimal toy async-await executor in web assembly
Rust
11
star
56

cryptoidentity

A library for simple crypto identity in the browser
JavaScript
10
star
57

web-local-storage-api

A pure Rust implementation of the Web Local Storage API, for use in non-browser contexts
Rust
10
star
58

SylvesterClosure

An Google Closure ready implementation of sylvester vector and matrix math library.
JavaScript
9
star
59

emoji-rs

Rust
9
star
60

hypershape

A hypermedia system for the metaverse inspired by Web 1.0 πŸ”ΊπŸŸ’ 🟦
TypeScript
8
star
61

aframe-keyboard

JavaScript
7
star
62

posterity_ukiyoe

A renderer agnostic GUI library
Rust
7
star
63

pong

pong in web assembly Rust
Rust
7
star
64

pinephone-electron-starter

Run electron app on pinephone
JavaScript
7
star
65

parallelogram

A library for distributing functional processing across web workers
JavaScript
7
star
66

virtual-dom-rs-hello-world

Rust
7
star
67

webassembly-rs

A Rust library for working with WebAssembly bytecode.
Rust
7
star
68

wasi.run

Run WASI anywhere.
TypeScript
6
star
69

keyvalue.js

A simple server for key value storage on heroku. Look at complete instructions below.
JavaScript
6
star
70

ClosureStackNodeJS

A templated webstack that uses NodeJS,Google Closure, JSDoc, Express, and django/jinja like templates. Basically this is a boilerplate project meant to reduce a lot of common steps to setup for using these technologies. Apache 2 licensed.
JavaScript
6
star
71

aframe-vuejs

HTML
5
star
72

usdz

A parser of USDZ file format in Rust
Rust
5
star
73

crdt-todo

An example application using CRDT library Automerge to make a TODO app
TypeScript
5
star
74

neonorigami

An open-source virtual world platform built on A-Frame
JavaScript
5
star
75

gago

A genetics algorithm library with speciation written in Go
Go
5
star
76

julia-opengl

A simple opengl example
Julia
5
star
77

FalloutMUD

A fan fiction MUD based in the Fallout universe.
JavaScript
5
star
78

cleanstack-isomorphic

CSS
5
star
79

pbr-scene

A simple web component library for using Google Filament
JavaScript
5
star
80

aframe-vive-starter

A simple starter project for aframe with vive
JavaScript
5
star
81

CleanStackGAE

My uber clean python web stack for Google App Engine using CherryPy, Jinja2, and REST.
Python
4
star
82

string_concat

A useful string concatenation macro for no_std Rust
Rust
4
star
83

metamorphosis

A GPGPU computation graph executor for web assembly πŸŒŸπŸ›πŸ¦‹
Rust
4
star
84

Logo

An old school logo implementation in HTML 5
JavaScript
4
star
85

generational-arena

A generational arena allocator for javascript
JavaScript
4
star
86

GenericRogue

JavaScript
4
star
87

FalloutCSS

Fallout 3 Terminal in HTML/CSS 3. Feel free to use for any purpose.
Shell
4
star
88

gundb_webrtc

A demonstration of WebRTC using distributed storage (GunDB) as signalling
JavaScript
4
star
89

shoji

A VBox/HBox layout library for Rust
Rust
3
star
90

TypeScriptChromeApp

A simple starter setup for a chrome app written in typescript.
JavaScript
3
star
91

julia-roguelike

A simple demo of a roguelike starter in Julia
Julia
3
star
92

cstring

A super simple library for c strings oriented toward web assembly needs
Rust
3
star
93

waste

A web assembly optimizer
Rust
3
star
94

stores

a reduceable store for Rust
Rust
3
star
95

save

a simple command for saving input steam
Rust
3
star
96

wcurses

a simple terminal control library for wasi
Rust
3
star
97

godot_openxr__rust

A simple Godot OpenXR Rust project that shows how to use trigger buttons and physical based rendering (PBR) on Vulkan graphics
GDScript
3
star
98

GooglePaymentsNodeJS

JavaScript
2
star
99

Underdark

A multiplayer roguelike game written in nodejs
JavaScript
2
star
100

Palettizer

2
star