Discover Packages
github.com/onexstack/onex
internal
pump
package
Version:
v0.2.0-alpha.14
Opens a new window with list of versions in this module.
Published: Jan 28, 2025
License: MIT
Opens a new window with license information.
Imports: 9
Opens a new window with list of imports.
Imported by: 0 modules, 0 packages
The first number is the count of modules that contain a package that imports this one.
The module count is a better indicator of popularity than the package count.
A module with 100 importing packages is counted only once instead of 100 times,
reflecting the fact that the choice to use the package was likely made only once,
not 100 times.
A '?' means that the value hasn't been computed yet.
Opens a new window with list of known importers.
README
README
¶
测试 chan source-filter-sink
如果想测试 onex-pump,可以使用以下代码来替换 Run:
func (s preparedServer) Run() error {
source := ext.NewChanSource(tickerChan(time.Second * 1))
filter := flow.NewMap(addUTC, 1)
sink := ext.NewStdoutSink()
source.Via(filter).To(sink)
return nil
}
func tickerChan(repeat time.Duration) chan any {
ticker := time.NewTicker(repeat)
oc := ticker.C
nc := make(chan any)
go func() {
for range oc {
nc <- &message{strconv.FormatInt(time.Now().UTC().UnixNano(), 10)}
}
}()
return nc
}
Expand ▾
Collapse ▴
Documentation
¶
Config contains application-related configurations.
NewServer initializes and returns a new Server instance.
Server represents the web server.
Run starts the server and listens for termination signals.
It gracefully shuts down the server upon receiving a termination signal.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.