Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Future Build Status

A condition-variable based Future type for synchronization in Go.

Controls an accompanying pointer, like Mutex or Cond, rather than trying to hack around the lack of generics.

Example

package main

import future "github.com/reem/go-future"
import "fmt"

type Data struct {
    x int
}

func main() {
    data := &Data{0}
    producer, consumer := future.Pair()

    go func() {
        data.x = 12
        producer.Complete()
    }()

    go func() {
        consumer.Await()
        fmt.Println("Received data, data.x ==", data.x)
    }()
}

Author

Jonathan Reem is the primary author and maintainer of future.

License

MIT

About

A condition-variable based Future type for synchronization

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages