Filters and Streams
Structural filters over verified local events, without a built-in subscription.
EventFilter has four sets—spaces, kinds, authors and references—and optional since/until timestamps. An empty set is a wildcard. Spaces/kinds/authors match membership; each requested reference must appear in the event. Time bounds are inclusive.
EventStream::query(&strand, &filter).await reads the supplied Strand; WovenTransportService::query uses its local Strand, and NexusEventFeed::query uses registered inputs. A filter does not query an entire network, verify author/DID ownership, or register a live subscription.
use woven::{EventFilter, EventStream, SpaceId};
async fn local_posts(strand: &strand::Strand) -> woven::Result<Vec<woven::EventRecord>> {
let filter = EventFilter::new()
.space(SpaceId::new("woven://dsocial/global")?)
.kind("social.post")
.since(1_777_000_000);
EventStream::query(strand, &filter).await
}For replies, call references(existing_event.id().clone()); an ellipsis in a fabricated event-reference string is not a usable identifier. To react to arriving events, drive handle_swarm_event with the application's Swarm receiver and apply filter.matches(&record.event) to accepted records. Handle receiver errors and rescan persisted state as needed. There is no built-in filter subscription or delivery guarantee.