Socket
Book a DemoInstallSign in
Socket

github.com/youngbloood/goabc

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/youngbloood/goabc

v0.0.0-20201013120515-1b3f24565f46
Source
Go
Version published
Created
Source

goabc

goroutine sequential execution

Usage

Define functions

func func1(){fmt.Println(11)}
func func2(){fmt.Println(22)}

Add

Add functions into goabc's queue, the same function can add to queue many times.

// add func1 two times, add func2 one time
goabc.Add(goabc.Func(func1),goabc.Func(func1),goabc.Func(func2))

Remove

Remove functions from goabc's queue, it will remove all the functions that in the queue.

// remove all func1
goabc.Remove(goabc.Func(func1))

Flush

flush all functions.

// flush the queue
goabc.Flush()

Hooker

Implement the hooker to handle the error customer.

goabc.SetHooker(hook)

Start

Start to execute the functions in goroutine ordered.

goabc.Start()

Run

Start to execute the functions orderd, not in goroutine.

goabc.Run()

Random

Start to execute the functions in goroutine, the execute order is random(decide by goroutine-invoke tool).

goabc.Random()

Customer Define Abcer

You can implement the Abcer interface to controll the execute ordered by youself.

FAQs

Package last updated on 13 Oct 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.