OxL Reference

fn subscribeCondOf

subscribeOf for a topic whose policy has conditions (bits: bit 0 an allow condition holds, bit 1 a deny condition holds). The generated T.subscribe(...) calls it.

Example:

oxl✓ checked in CI
data Ev { amount: i64 }

topic Evs: Ev

policy Evs {
  allow subscribe if caller.isUser("reader")
}

cluster demo {
  role store { journal }
}

fn tail() -> () | TopicError io, db {
  for await e in Evs.subscribe(from: .Latest) {
    print("{e.amount}")
  }
}
pub(api) fn subscribeCondOf<T: Serializable>(h: i64, group: str, key: bytes, hasKey: i64, from: TopicStart?, lease: Duration, bits: i64) -> stream<T, TopicError>  db

Since. 1.0.0-beta

Parameters

NameType
hi64
groupstr
keybytes
hasKeyi64
fromTopicStart?
leaseDuration
bitsi64

Returns

stream<T, TopicError>

Effects

db

Defined in: std/topic/topic.oxl:614

See also