sync

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 29, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package sync provides synchronization utilities

Index

Constants

This section is empty.

Variables

View Source
var PromiseType = types.MakeBasic("promise")

Functions

This section is empty.

Types

type Action

type Action func(func())

Action is a callback interface for eventually triggering some action

func Always

func Always() Action

Always returns a Do instance for always performing an action

func Never

func Never() Action

Never returns a Do instance for never performing an action

func Once

func Once() Action

Once creates a Do instance for performing an action only once

type Promise

type Promise struct {
	// contains filtered or unexported fields
}

A Promise represents a Value that will eventually be resolved

func NewPromise

func NewPromise(resolver data.Procedure) *Promise

NewPromise instantiates a new Promise

func (*Promise) Call

func (p *Promise) Call(...ale.Value) ale.Value

func (*Promise) CheckArity

func (p *Promise) CheckArity(c int) error

func (*Promise) Equal

func (p *Promise) Equal(other ale.Value) bool

func (*Promise) Get

func (p *Promise) Get(key ale.Value) (ale.Value, bool)

func (*Promise) IsResolved

func (p *Promise) IsResolved() bool

func (*Promise) Type

func (p *Promise) Type() ale.Type

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL