xpool

package
v0.0.0-...-a29d1be Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2026 License: MIT, MIT Imports: 5 Imported by: 0

Documentation

Overview

Package xpool 第三方脚本片段集存储与检索。 用于 GOTO、EMBED 指令快速获取第三方脚本。在所有Goroutines之间共享,并发安全。

Index

Constants

View Source
const Size = 1 << 14

池大小。 超出的量会被监控服务器定期削平(随机移除)。

Variables

This section is empty.

Functions

func Get

func Get(h, n, i int) []byte

获取目标脚本。 参数: h 交易所在区块高度。 n 交易ID在其区块中的序位,从0开始。 i 脚本在输出集中的序位,从0开始。

func Serve

func Serve(limit int)

创建一个池服务。 主要用于监控池大小是否超出限定, 在到达limit时间后检查,超出多少即移除多少(恢复到限定水平)。 注意: 应当仅被调用一次,此函数自身并非并发安全。 服务启动后会一直执行,直到程序自身停止运行。

Types

This section is empty.

Jump to

Keyboard shortcuts

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