OxL Справочник OxL
РусскийEnglish

fn subscribeKeyCondOf

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

Example:

oxl✓ проверяется в CI
data Ev {
  userId: str
  amount: i64
}

topic Evs: Ev sharded by .userId

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

cluster demo {
  role store { journal }
}

fn watch(uid: str) -> () | TopicError io, db {
  for await e in Evs.subscribeKey(uid, from: .Earliest) {
    print("{e.amount}")
  }
}
pub(api) fn subscribeKeyCondOf<T: Serializable, K: Serializable>(h: i64, key: &K, from: TopicStart?, bits: i64) -> stream<T, TopicError>  db

С версии. 1.0.0-beta

Параметры

ИмяТип
hi64
key&K
fromTopicStart?
bitsi64

Возвращает

stream<T, TopicError>

Эффекты

db

Определено в: std/topic/topic.oxl:551

См. также