maint

package
v0.0.0-...-b044761 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Call

func Call(f func())

Call calls f on the main thread and blocks until f finishes.

func Init

func Init(run func())

Init initializes the functionality for running arbitrary subsequent functions on the main system thread.

Init must be called in the main package.

Example
package main

import (
	"fmt"

	"changkun.de/x/pkg/maint"
)

func main() {
	maint.Init(func() {
		maint.Call(func() {
			fmt.Println("from main thread")
		})
	})
}
Output:

from main thread

Types

This section is empty.

Jump to

Keyboard shortcuts

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