All Projects → jiansoft → robin

jiansoft / robin

Licence: MIT license
robin provides a high performance golang goroutine library and job scheduling、in-memory cache for humans.

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to robin

every
Fluent API job scheduling engine for .NET
Stars: ✭ 22 (-21.43%)
Mutual labels:  job-scheduler
libcache
A caching library that provides an in-memory and file based cache for Ruby
Stars: ✭ 25 (-10.71%)
Mutual labels:  memory-cache
.NetCorePluginManager
.Net Core Plugin Manager, extend web applications using plugin technology enabling true SOLID and DRY principles when developing applications
Stars: ✭ 17 (-39.29%)
Mutual labels:  memory-cache
scattersphere
Job Coordination API for Tasks
Stars: ✭ 30 (+7.14%)
Mutual labels:  job-scheduler
agendash-v2
A modern, secure, and reliable dashboard for Agenda with search and pagination capabilities written in vue.js
Stars: ✭ 27 (-3.57%)
Mutual labels:  job-scheduler
CodablePersist
Store and Cache Anything Codable
Stars: ✭ 18 (-35.71%)
Mutual labels:  memory-cache
rapp
Cross-platform entry point library
Stars: ✭ 57 (+103.57%)
Mutual labels:  job-scheduler
image-loader
Image loading library for Android
Stars: ✭ 19 (-32.14%)
Mutual labels:  memory-cache
SwiftlyCache
SwiftlyCache is a thread safe IOS general cache Library
Stars: ✭ 84 (+200%)
Mutual labels:  memory-cache
go-xxl-job-client
xxl-job go client
Stars: ✭ 36 (+28.57%)
Mutual labels:  job-scheduler
Unity-Multithreaded-Job-System
A multithreaded job system for Unity3d
Stars: ✭ 23 (-17.86%)
Mutual labels:  job-scheduler
tasq
A simple task queue implementation to enqeue jobs on local or remote processes.
Stars: ✭ 83 (+196.43%)
Mutual labels:  job-scheduler
task-spooler
A scheduler for GPU/CPU tasks
Stars: ✭ 77 (+175%)
Mutual labels:  job-scheduler
SQLServerTools
This repo is the home of various SQL-Server-Tools
Stars: ✭ 28 (+0%)
Mutual labels:  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 (+635.71%)
Mutual labels:  job-scheduler
job-schedule-tutorials
分布式任务调度框架教程, 包括: Quartz、Elastic-Job和TBSchedule.
Stars: ✭ 31 (+10.71%)
Mutual labels:  job-scheduler
orkid-node
Reliable and modern Redis Streams based task queue for Node.js 🤖
Stars: ✭ 61 (+117.86%)
Mutual labels:  job-scheduler
reactr
Function scheduler for Go & WebAssembly
Stars: ✭ 264 (+842.86%)
Mutual labels:  job-scheduler
tracking-location-provider-android
Tracking the android mobile and animating marker smoothly in Google Maps. Tracking has been done both in foreground and background. Tested in Android Oreo 8.1, Android 6.0 and Android 5.0
Stars: ✭ 37 (+32.14%)
Mutual labels:  job-scheduler
memcacher
C++ implementation of Memcache Binary Protocol.
Stars: ✭ 16 (-42.86%)
Mutual labels:  memory-cache

robin

GitHub FOSSA Status Go Report Card Build Status codecov

Features

Fiber

  • GoroutineSingle - a fiber backed by a dedicated goroutine. Every job is executed by a goroutine.
  • GoroutineMulti - a fiber backed by more goroutine. Each job is executed by a new goroutine.

Channels

  • Channels callback is executed for each message received.

Cron

Golang job scheduling for humans. It is inspired by schedule.

Memory Cache

Implements an in-memory cache key:value (similar to C# MemoryCache)

Usage

Quick Start

1.Install

  go get github.com/jiansoft/robin

2.Use examples

import (
    "log"
    "time"
    
    "github.com/jiansoft/robin"
)

func main() {
    
    //Keep an item in memory 
    robin.Memory().Keep("qq", "Qoo", time.Second)
    //Read returns the value if the key exists in the cache and it's not expired.
    val, ok := robin.Memory().Read("qq")
    //Have eturns true if the memory has the item and it's not expired.
    yes := robin.Memory().Have("qq")
    //Removes an item from the memory
    robin.Memory().Forget("qq")

    //The method is going to execute only once after 2000 ms.
    robin.Delay(2000).Do(runCron, "a Delay 2000 ms")
    
    minute := 11
    second := 50
    
    //Every Friday is going to execute once at 14:11:50 (HH:mm:ss).
    robin.EveryFriday().At(14, minute, second).Do(runCron, "Friday")

    //Every N day  is going to execute once at 14:11:50(HH:mm:ss)
    robin.Every(1).Days().At(14, minute, second).Do(runCron, "Days")

    //Every N hours is going to execute once at 11:50:00(HH:mm:ss).
    robin.Every(1).Hours().At(0, minute, second).Do(runCron, "Every 1 Hours")

    //Every N minutes is going to execute once at 50(ss).
    robin.Every(1).Minutes().At(0, 0, second).Do(runCron, "Every 1 Minutes")

    //Every N seconds is going to execute once
    robin.Every(10).Seconds().Do(runCron, "Every 10 Seconds")
    
    p1 := player{Nickname: "Player 1"}
    p2 := player{Nickname: "Player 2"}
    p3 := player{Nickname: "Player 3"}
    p4 := player{Nickname: "Player 4"}
    
    //Create a channel
    channel := robin.NewChannel()
    
    //Four player subscribe the channel
    channel.Subscribe(p1.eventFinalBossResurge)
    channel.Subscribe(p2.eventFinalBossResurge)
    p3Subscribe := channel.Subscribe(p3.eventFinalBossResurge)
    p4Subscribe := channel.Subscribe(p4.eventFinalBossResurge)
    
    //Publish a message to the channel and then the four subscribers of the channel will 
    //receives the message each that "The boss resurge first." .
    channel.Publish("The boss resurge first.")
    
    //Unsubscribe p3 and p4 from the channel.
    channel.Unsubscribe(p3Subscribe)
    p4Subscribe.Unsubscribe()
    
    //This time just p1 and p2 receives the message that "The boss resurge second.".
    channel.Publish("The boss resurge second.")
    
    //Unsubscribe all subscribers from the channel
    channel.Clear()
    
    //The channel is empty so no one can receive the message
    channel.Publish("The boss resurge third.")
}

func runCron(s string) {
    log.Printf("I am %s CronTest %v\n", s, time.Now())
}

type player struct {
	Nickname string
}
func (p player) eventFinalBossResurge(someBossInfo string) {
	log.Printf("%s receive a message : %s", p.Nickname, someBossInfo)
}

More example

License

Copyright (c) 2017

Released under the MIT license:

FOSSA Status

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