PathrockNetwork Gno Explorer
HomeBlocksTransactionsRealmsPackagesValidatorsAnalytics

PathrockNetwork Gno Explorer — an independent explorer for Gno.land Mainnet (gnoland-1), operated by PathrockNetwork. Not an official Gno.land service.

gnowebarchive RPC

gno.land/r/moul/x/daily/heapdemo/v0

Realm
Open in gnoweb ↗

Overview

Kind
Realm (renderable)
Name
v0
Namespace
moul / x / daily / heapdemo
Files
3 (README)(gnomod.toml)
Exported functions
1
Module
gno.land/r/moul/x/daily/heapdemo/v0
gno
0.9

Files (3)

  • README.mdmarkdown
  • gnomod.tomltoml
  • heapdemo.gnogno

Select a file to view its exact on-chain source. Sorted README → gnomod → sources → tests.

Functions

  • Render(path string) string

Signatures reconstructed verbatim from vm/qfuncs — interface params keep their inline definitions.

Rendered
RenderedRawgnoweb ↗
# Binary Heap

A priority queue, demoing the [`p/moul/x/daily/heap`](/p/moul/x/daily/heap/v0) library.

## The workload

| job | priority |
|---|---|
| send email | 5 |
| pay invoice | 1 |
| backup db | 3 |
| rotate keys | 1 |
| clear cache | 9 |

## Min-heap — lowest priority first

| # | job | priority |
|---|---|---|
| 1 | pay invoice | 1 |
| 2 | rotate keys | 1 |
| 3 | backup db | 3 |
| 4 | send email | 5 |
| 5 | clear cache | 9 |

## Max-heap — highest priority first

| # | job | priority |
|---|---|---|
| 1 | clear cache | 9 |
| 2 | send email | 5 |
| 3 | backup db | 3 |
| 4 | pay invoice | 1 |
| 5 | rotate keys | 1 |

## Ties

`pay invoice` and `rotate keys` share priority 1. Both heaps pop them **oldest-first**: the tiebreak is insertion order and does *not* invert with the heap kind.

> Without a total order, two nodes could pop equal-priority items in different sequences and render different pages — a consensus bug, not a cosmetic one.

vm/qrender output, sanitized (docs/render-security.md) and displayed in an empty-sandbox iframe — scripts, forms and popups cannot run. Links stay inert in-preview; right-click to open.