All Projects → suborbital → reactr

suborbital / reactr

Licence: Apache-2.0 license
Function scheduler for Go & WebAssembly

Programming Languages

go
31211 projects - #10 most used programming language
typescript
32286 projects
rust
11053 projects
swift
15916 projects
javascript
184084 projects - #8 most used programming language
c
50402 projects - #5 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to reactr

Swiftqueue
Job Scheduler for IOS with Concurrent run, failure/retry, persistence, repeat, delay and more
Stars: ✭ 276 (+4.55%)
Mutual labels:  scheduler, job-scheduler
Smart Scheduler Android
A utility library for scheduling periodic and non-periodic jobs efficiently.
Stars: ✭ 930 (+252.27%)
Mutual labels:  scheduler, job-scheduler
Db Scheduler
Persistent cluster-friendly scheduler for Java
Stars: ✭ 352 (+33.33%)
Mutual labels:  scheduler, job-scheduler
yerbie
A blazing fast job queue built for ease of use and scalability
Stars: ✭ 16 (-93.94%)
Mutual labels:  scheduler, job-scheduler
Cylc Flow
Cylc: a workflow engine for cycling systems. Repository master branch: core meta-scheduler component of cylc-8 (in development); Repository 7.8.x branch: full cylc-7 system.
Stars: ✭ 154 (-41.67%)
Mutual labels:  scheduler, job-scheduler
Taskscheduler
Cross-platform, fiber-based, multi-threaded task scheduler designed for video games.
Stars: ✭ 402 (+52.27%)
Mutual labels:  scheduler, job-scheduler
Quartznet
Quartz Enterprise Scheduler .NET
Stars: ✭ 4,825 (+1727.65%)
Mutual labels:  scheduler, job-scheduler
Jiacrontab
简单可信赖的任务管理工具
Stars: ✭ 1,052 (+298.48%)
Mutual labels:  scheduler, job-scheduler
Workq
Job server in Go
Stars: ✭ 1,546 (+485.61%)
Mutual labels:  scheduler, job-scheduler
Go Quartz
Simple, zero-dependency scheduling library for Go
Stars: ✭ 118 (-55.3%)
Mutual labels:  scheduler, job-scheduler
go-xxl-job-client
xxl-job go client
Stars: ✭ 36 (-86.36%)
Mutual labels:  scheduler, job-scheduler
Jobs
jobs 分布式任务调度平台
Stars: ✭ 245 (-7.2%)
Mutual labels:  scheduler, job-scheduler
gronx
Lightweight, fast and dependency-free Cron expression parser (due checker), task scheduler and/or daemon for Golang (tested on v1.13 and above) and standalone usage
Stars: ✭ 206 (-21.97%)
Mutual labels:  scheduler, job-scheduler
pigmnts
🎨 Color palette generator from an image using WebAssesmbly and Rust
Stars: ✭ 38 (-85.61%)
Mutual labels:  wasm
swaplink
Site to perform peer to peer atomic swaps on the Algorand blockchain
Stars: ✭ 15 (-94.32%)
Mutual labels:  wasm
Glaedr
An extensive, modular functional scoreboard library for the Bukkit/Spigot API.
Stars: ✭ 23 (-91.29%)
Mutual labels:  beta
microless
Using docker and nodejs to build Microservice
Stars: ✭ 16 (-93.94%)
Mutual labels:  faas
report-a-cybercrime
Report a computer crime or scam / Signaler un crime informatique ou une fraude
Stars: ✭ 28 (-89.39%)
Mutual labels:  beta
wasm.cljc
Spec compliant WebAssembly compiler, decompiler, and generator
Stars: ✭ 178 (-32.58%)
Mutual labels:  wasm
outspline
Extensible outliner and personal time organizer to manage todo lists, schedule tasks, remind events.
Stars: ✭ 41 (-84.47%)
Mutual labels:  scheduler

SOS_Reactr-Long-FullColour

Reactr is a fast, performant function scheduling library. Reactr is designed to be flexible, with the ability to run embedded in your Go applications and first-class support for WebAssembly.

Reactr runs functions called Runnables, and transparently spawns workers to process jobs. Each worker processes jobs in sequence, using Runnables to execute them. Reactr jobs are arbitrary data, and they return arbitrary data (or an error). Jobs are scheduled, and their results can be retrieved at a later time.

Wasm

Reactr has support for Wasm-packaged Runnables. The engine package contains a multi-tenant Wasm scheduler, an API to grant capabilities to Wasm Runnables, and support for several languages including Rust (stable), TypeScript/AssemblyScript (beta), and Swift (alpha). See Wasm and the Subo CLI for details.

The Basics

First, install Reactr's core package rt:

go get github.com/suborbital/reactr/rt

And then get started by defining something Runnable:

package main

import (
	"fmt"

	"github.com/suborbital/reactr/rt"
)

type generic struct{}

// Run runs a generic job
func (g generic) Run(job rt.Job, ctx *rt.Ctx) (interface{}, error) {
	fmt.Println("doing job:", job.String()) // get the string value of the job's data

	// do your work here

	return fmt.Sprintf("finished %s", job.String()), nil
}

// OnChange is called when Reactr starts or stops a worker to handle jobs,
// and allows the Runnable to set up before receiving jobs or tear down if needed.
func (g generic) OnChange(change rt.ChangeEvent) error {
	return nil
}

A Runnable is something that can take care of a job, all it needs to do is conform to the Runnable interface as you see above.

Once you have a Runnable, create a Reactr instance, register it, and Do some work:

package main

import (
	"fmt"
	"log"

	"github.com/suborbital/reactr/rt"
)

func main() {
	r := rt.New()

	r.Register("generic", generic{})

	result := r.Do(r.Job("generic", "hard work"))

	res, err := result.Then()
	if err != nil {
		log.Fatal(err)
	}

	fmt.Println("done!", res.(string))
}

When you Do some work, you get a Result. A result is like a Rust future or a JavaScript promise, it is something you can get the job's result from once it is finished.

Calling Then() will block until the job is complete, and then give you the return value from the Runnable's Run. Cool, right?

Reactr has some very powerful capabilities, visit the Reactr guide to learn more.

Reactr is being actively developed and has planned improvements, including optimized memory usage, library stability, data persistence, and more. Cheers!

Copyright Suborbital contributors 2021

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].