MinDelayBlocks
int64Value
1
MaxDelayBlocks
int64Value
2500000
MaxTTLBlocks
int64Value
2500000
MaxOpen
untyped bigintValue
(200 <untyped> bigint)
MaxTextLen
untyped bigintValue
(280 <untyped> bigint)
MaxPublishedKept
untyped bigintValue
(50 <untyped> bigint)
MaxListed
untyped bigintValue
(50 <untyped> bigint)
book
*duebook.Bookbook holds the scheduled announcements. It is unexported and never returned: handing a \*Book across a realm boundary would hand out the right to schedule, cancel and claim (duebook consumer contract 3).
- OID
- 0b82c8…10e4:4
book details
publication
typepublication is one published announcement, kept for rendering.
Value
duebook_demo.publication
published
*v0.Tree// padded seq -> \*publication
- OID
- 0b82c8…10e4:9
published details
publishedTotal
int64// every publication ever, including evicted
Value
2
nextSeq
int64Value
3
rejectStraySend
func()rejectStraySend aborts if an EOA attached coins to an entrypoint that has no use for them. This realm never holds value; without this guard a mistyped send would be silently absorbed by the realm bank.
- OID
- 0b82c8…10e4:13
rejectStraySend details
Schedule
func(text string, delayBlocks int64, ttlBlocks int64) stringSchedule registers an announcement to be published no earlier than delayBlocks from the current height, and returns its deferral ID. ttlBlocks is how long after the due height the announcement stays publishable; 0 means it never expires. The caller becomes the owner and is the only account that may Cancel it.
- OID
- 0b82c8…10e4:15
Schedule details
Publish
func(id int64) stringPublish publishes a scheduled announcement once it is due. It is deliberately permissionless: duebook's exactly-once Claim is the only thing preventing a second publication, which is precisely what this realm exists to demonstrate. Aborts if the announcement does not exist, is not due yet, has expired, or has already been consumed by a publication or a cancellation.
- OID
- 0b82c8…10e4:16
Publish details
Cancel
func(id int64) stringCancel withdraws a scheduled announcement before it is published. Only the account that scheduled it may cancel, and only while it is still open — a cancellation that arrives after publication aborts.
- OID
- 0b82c8…10e4:17
Cancel details
Expire
func(id int64) stringExpire clears an announcement whose time-to-live has elapsed, freeing its slot against MaxOpen. It is permissionless because an expired announcement can never be published, so there is nothing left to protect and everything to gain from letting anyone tidy up.
- OID
- 0b82c8…10e4:18
Expire details
Height
func() int64Height returns the chain height this realm is reading as "now".
- OID
- 0b82c8…10e4:19
Height details
OpenCount
func() intOpenCount returns how many announcements are currently scheduled.
- OID
- 0b82c8…10e4:20
OpenCount details
PublishedTotal
func() int64PublishedTotal returns how many announcements have ever been published, including ones since evicted from the rendered window.
- OID
- 0b82c8…10e4:21
PublishedTotal details
NextID
func() stringNextID returns the deferral ID the next Schedule will allocate. It only ever increases; that is what makes a consumed ID permanently unusable.
- OID
- 0b82c8…10e4:22
NextID details
Status
func(id int64) stringStatus describes a scheduled announcement: its window, and whether it is publishable right now. Returns "unknown" when the ID was never issued or has already been consumed — duebook keeps no tombstone, so those two cases are indistinguishable by design.
- OID
- 0b82c8…10e4:23
Status details
DueNow
func() stringDueNow returns the IDs of announcements publishable at the current height, oldest first, capped at MaxListed.
- OID
- 0b82c8…10e4:24
DueNow details
ExpirableNow
func() stringExpirableNow returns the IDs that Expire would accept at the current height, oldest first, capped at MaxListed.
- OID
- 0b82c8…10e4:25
ExpirableNow details
realmPath
untyped stringrealmPath is this realm's gnoweb prefix, used to build view links.
Value
"/r/g1ut6uspuh73e02yauxpmyt8g3wwddaq8utagvm3/duebook_demo"
Render
func(path string) stringRender serves three views, selected by path. Anyone may Schedule, so the default view must not be something a stranger can inflate: it shows only what is publishable right now, capped at MaxListed. The full scheduled table lives behind :open and is capped too, so no view is unbounded and none of them is the landing page by default. (empty) summary + publishable now + recent publications open every scheduled announcement, up to MaxListed rows about what this realm is and why it exists
- OID
- 0b82c8…10e4:26
Render details
renderHeader
func() string- OID
- 0b82c8…10e4:27
renderHeader details
renderDue
func() stringrenderDue lists only what can be published at this height. book.Due applies the cap itself, so the slice is at most MaxListed long.
- OID
- 0b82c8…10e4:28
renderDue details
renderOpen
func() stringrenderOpen lists the whole book, stopping at MaxListed rows so this view has a fixed ceiling independent of MaxOpen.
- OID
- 0b82c8…10e4:29
renderOpen details
renderRows
func(ds []duebook.Deferral, now int64) string- OID
- 0b82c8…10e4:30
renderRows details
renderPublished
func() stringrenderPublished shows the retained window, which evictOldest already holds at MaxPublishedKept entries.
- OID
- 0b82c8…10e4:31
renderPublished details
renderAbout
func() string- OID
- 0b82c8…10e4:32
renderAbout details
normalizePath
func(path string) stringnormalizePath reduces a gnoweb render path to a bare view name, so "", "/", "open" and "/open/" all select the same view.
- OID
- 0b82c8…10e4:33
normalizePath details
mustID
func(id int64) uint64mustID converts an exported int64 ID to duebook's uint64 form. IDs start at 1, so anything below that was never issued.
- OID
- 0b82c8…10e4:34
mustID details
evictOldest
func()evictOldest trims the rendered window to MaxPublishedKept, dropping the lowest sequence numbers first. Evicted publications remain in the emitted events.
- OID
- 0b82c8…10e4:35
evictOldest details
seqKey
func(seq int64) stringseqKey encodes a sequence number so avl's lexical order matches numeric order. Sequences are positive int64, at most 19 digits.
- OID
- 0b82c8…10e4:36
seqKey details
itoa
func(n int64) string- OID
- 0b82c8…10e4:37
itoa details
utoa
func(n uint64) string- OID
- 0b82c8…10e4:38