Reticulum-Go/pkg/backbone/backbone_default.go
Ivan 8c3492b2b7
fix: select the portable Go poller as DefaultBackend on TinyGo
Keep epoll and kqueue on standard Go, and stop TinyGo from trying
those backends on linux hosts.
2026-08-15 01:17:48 -05:00

20 lines
413 B
Go

// SPDX-License-Identifier: Apache-2.0
// Copyright (c) 2024-2026 Quad4.io
//go:build !tinygo
package backbone
import "runtime"
// DefaultBackend picks the native multiplexer for the current platform.
func DefaultBackend() Backend {
switch runtime.GOOS {
case "linux", "android":
return BackendEpoll
case "darwin", "freebsd", "netbsd", "openbsd":
return BackendKqueue
default:
return BackendGo
}
}