Documentation
¶
Overview ¶
Package unicast publishes a producer's objects to overlay hosts one by one, for a deployment with no multicast plane.
On the plane a producer submits each object once, to one facade, and the plane delivers it to every host subscribed to the topic and repairs what is lost on the way. Without the plane the producer does that itself: a Set submits every object to each of its hosts individually, retries each host on its own, and reports each host's answer. The object counts as published when at least Need hosts took it. A host that missed it does not receive it from the others; blogs backfill copies it across later.
"Took it" means the host answered the submit with 200 and a STEAK for the topic. A host that answers with nothing admitted has decided (it holds the object already, or its topic manager refused it); resending cannot change that, so it is reported and counted as an answer, never retried.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Outcome ¶
Outcome is every host's answer to one submit.
func (Outcome) Err ¶
Err is nil when the outcome is OK, and otherwise names every host that missed the object and why.
type Result ¶
type Result struct {
Host string
// Result is the host's STEAK entry when Err is nil.
Result publish.Result
// Err is the last failure when every try failed.
Err error
// Tries is how many times the host was asked.
Tries int
}
Result is one host's answer to one submit.
type Set ¶
type Set struct {
// Hosts are the hosts' base URLs; each is POSTed <base>/submit.
Hosts []string
// Need is how many hosts must take an object for Submit to succeed.
Need int
// Retries are the waits between the tries of one host: a host is tried
// 1+len(Retries) times before it is counted as missed.
Retries []time.Duration
// HTTP is the client each host's facade uses; nil is bcommon's default.
HTTP *http.Client
// Note receives a line per host that did not take an object, and with
// Verbose a line per host that did.
Note func(format string, args ...any)
Verbose bool
// contains filtered or unexported fields
}
Set is the hosts a producer submits to.
func (*Set) Facade ¶
Facade is a publish.Facade whose every Submit is a Send to the whole Set with the Set's quorum, for code that takes one facade (bcommon's producer.Trees publishes each funding tree it adopts through one). Its base URL is never dialled: its transport answers every request itself. what names the objects it carries in notes.