class

Rules::View::Feed

Inherits Rules::View < Reference < Object

An algorithmic feed's view.

Unlike the singleton views, feeds are runtime-created, so instances are constructed and registered from those rows -- never here.

An object is a member when it is a candidate for the feed and has a verdict for the feed's version that is included.

Constants

CANDIDATE_SQL = " objects.published IS NOT NULL\n AND objects.special IS NULL\n AND (\n objects.visible = 1\n OR EXISTS (\n SELECT 1\n FROM relationships m\n JOIN activities a ON a.iri = m.to_iri\n WHERE m.type IN (?, ?)\n AND m.from_iri = ?\n AND a.object_iri = objects.iri\n AND a.undone_at IS NULL\n )\n )"

The candidate predicate, over objects. Feed::Candidates embeds it too, so membership and candidacy agree by construction. Binds the inbox and outbox types and the feed owner's IRI.

Constructors

new(feed_id : Int64, owner_iri : String)
Source

Instance methods

feed_id
Source
membership(key : Key | Nil = nil) : Tuple(String, Array(DB::Any))

The membership query, plus its bind arguments.

The query selects rows of (from_iri, to_iri, position). A key of nil returns the full set (the batch reconcile); otherwise it returns the form scoped to a single member.

Source
owner_iri
Source
project(object_iri : String) : Array(Key)

Maps a changed base fact to the collection key(s).

Source
stored_scope

Every stored row belongs to the feed's owner.

Source
subjects(username : String) : Array(String)

The pub/sub subjects to notify when one of username's rows in this view changes.

It's empty by default -- the view publishes no real-time updates. Views that do mix in NotifiesNotifications or NotifiesTimeline.

Source
type

The relationship subtype this view materializes.

Source