hxn

Knowledge

Typed knowledge capture and explicit bounded publication on the Haxe event thread.

capture(value) reads @:identity, @:fact, @:relation and @:spatial selections from a class/typedef annotated with @:knowledge. It returns an owned KnowledgeSnapshot. remove(value) captures only schema/identity for a tombstone. These two functions are compile-time macros and require the declared input type. Publication uses a configured KnowledgeSink and explicit increasing revisions. See https://github.com/hx-n/hxn-assets/blob/main/docs/knowledge.md.

Constructor

function new(namespace:String, source:String, sink:KnowledgeSink)

Methods

function publish(revision:Int, snapshots:Array<KnowledgeSnapshot>):Future<Unit>

Publishes a full selected snapshot per changed entity, coalescing repeated identities.

function retry():Future<Unit>

Replays the identical owned batch after an ambiguous failure; no hidden reconnect.