package stateobjects import ( "encoding/json" "fmt" stdio "git.novox.be/novox/mesh-sdk/go" "git.novox.be/novox/mesh-sdk/go/buscalls" ) // MessageLimit is the most a message of the bus carries when the sender does not know its connection's own // (`nc.MaxPayload()`), and MessageHeaderRoom what the headers and the subject take of it. const ( MessageLimit = 1 << 20 MessageHeaderRoom = 8 << 10 ) // Sender sends the body of a verb's reply or an event: a body over the per-message limit is put in the sender's store of // sent objects and its reference is sent instead (ADR 0666 ยง16). The store is the bus module's `_sent-objects`, // granted to the sender alone and read by the callers its seat definition names and the consumers that declare the event; // a sent object lives as long as that store's age, which is transport and not kept data. type Sender struct { // Objects is the sender's store of sent objects, and Store its name as a reader asks for it. Objects Objects Store string // Limit is the connection's largest message; zero is MessageLimit. Limit int } // Send is what to send for body: the body itself when it fits, else the reference of the object it was put in as // `