modus
Menu
On this page

The entry log_follower

The follower of the machine test of log.follow . It connects to the log service, wires log.follow to itself as its asker, in a ring of FOLLOW_CAPACITY compartments, and reads the joined record. Then it falls behind on purpose: it reads nothing, and writes log records of its own until the kernel took FLOOD_TARGET of them, more than the whole log holds past the ring. The log service keeps its place at the first row that the full ring refused, and the kernel writes over the records after it: when this process reads again, the service must write one gap record of their count where they were.

The checks, on what this process reads after the joined record:

  • the rows before the gap have consecutive serials and consecutive numbers of the whole log;
  • the gap record comes before the rows can no longer meet, at most FOLLOW_CAPACITY + 1 compartments after the joined record, with a count of 1 or more, at the serial after the last row;
  • the row after the gap has the serial after the gap, and a number of the whole log that is the number of the last row before the gap, plus the count of the gap, plus 1: the gap says exactly the records lost.

No check reads a time. The flood is paced by the clock of the log budget: each batch starts at the next whole second, and its lines are fewer than half the records of a second, so the kernel takes each one wherever the second of the kernel falls; a refused line only makes one more batch. Its lines before the result wait for the next second as well: no step waits for a line right after this process wrote more lines than its log records of one second.

Start: start("log_follower") in the console, with the window log running. What a reader sees: no window; one line "log_follower: ...: as it must", or a line "log_follower: WRONG: ...". It stops itself with the outcome Done, or Failed after a WRONG line.

See: Log facts: typed records in place of formatted lines: The frequent tasks in the repository

log_follower module with an entry

Hash
8c7c0bea376686f05f849dc5a44b633584174a3b9aeec9f4ca459ce8a2c2d44d
Size
67689 bytes
Exports
0
Imports
0
Imported by
0
License
MIT

The follower of the machine test of log.follow

FactValue
KindModules with an entry
Sourcesrc/modules/tests/log_follower
Boot imageyes: in the boot image, 67689 bytes in this build
Build settingsnone: the defaults of the source
Importsnone
Imported bynone

Neighbours

It imports no module, and no module imports it. The module graph shows it with the other modules that have no edge.

Exports

ExportWhat it does
entry()

entry

entry()
Form
The entry of the module: one parameter, an address, fixed by the contract.
Source
src/modules/tests/log_follower/main.odin:196

Read from the source of the module, as the build reads it to describe the exports (tools/modustool/build/describe.odin).

What the root service gives it

WhatValueAs the root service says
GrantsThe follower of the test of log.follow: Connect and Wire are commands of the root ring, and the end Connected of log.follow is given only to a caller that acts for the principal: log.follow carries the records of the whole log.
Other terms of its start grant setnone
Budget that it asks for
  • the least budget
No MODULE_BUDGET in its source: it asks for the least budget.

The start grant set is read from start_grant_sets in src/modules/system/root/start_grant_sets.odin. The stated budget is read from the constant MODULE_BUDGET of the source of the module; the build adds the counted parts and writes the sum in the module (tools/modustool/build/budget_count.odin); the root service accepts it up to the largest budget of a process, and adds the limits of processor time and of log records (src/modules/system/root/budgets.odin).

follow global variable of the package log

follow: system.Record_Output(Follow_Row)

The records of the whole log, from the next one on, for a caller that.

src/modules/system/log/follow.odin:70