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:
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> dbSince. 1.0.0-beta
Parameters
| Name | Type |
|---|---|
h | i64 |
group | str |
key | bytes |
hasKey | i64 |
from | TopicStart? |
lease | Duration |
bits | i64 |
Returns
stream<T, TopicError>
Effects
db
Defined in: std/topic/topic.oxl:614