Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gitlab.com/albert_einstein/async

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gitlab.com/albert_einstein/async

  • v0.1.2
  • Source
  • Go
  • Socket score

Version published
Created
Source

async

This service transforms a source of Go function(method) into a state-machine by:

  • Creating a struct where all function local variables become struct fields
  • Rewriting control flow into a struct tree, so that we can jump to any statement we want

This allows us to write statemachines in Go with

  • Ease of writing and reading Go code
  • Ability to save, dump, modify & resume it's state
  • Type-safety of the code before & after transformation

See test folder for more info on how it works and how to use it.

The idea for this service is to leverage https://gitlab.com/albert_einstein/slct service to build asyncronous Go statemachine runtime.

Limitations:

  • Only pure structs are currently supported
  • You have to put '// :' comment after select statement and calls to other async functions. Theese serve as resume label for engine to know where to resume the process. For example "order.update" tells engine that the process should be resumed at function iwth "order" label and inside the function at label "update"
  • The generation is pretty brittle - lots of features are not supported, so see test folder on what you can currently do.

FAQs

Package last updated on 28 Aug 2019

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc