corrosion/subscription

Types

pub type ChangeType {
  Insert
  Update
  Delete
}

Constructors

  • Insert
  • Update
  • Delete
pub type Event(datatype) {
  Row(row_id: Int, data: datatype)
  Change(
    change_type: ChangeType,
    row_id: Int,
    data: datatype,
    change_id: Int,
  )
  EndOfQuery(time: Float, change_id: option.Option(Int))
  QueryError(message: String)
  DecodeError(List(decode.DecodeError))
  Closed
}

Constructors

  • Row(row_id: Int, data: datatype)
  • Change(
      change_type: ChangeType,
      row_id: Int,
      data: datatype,
      change_id: Int,
    )
  • EndOfQuery(time: Float, change_id: option.Option(Int))
  • QueryError(message: String)
  • DecodeError(List(decode.DecodeError))
  • Closed
pub type Message {
  Shutdown
}

Constructors

  • Shutdown

Values

pub fn subscribe(
  corro_uri: uri.Uri,
  statement: statement.Statement,
  row_decoder: decode.Decoder(datatype),
  recv: process.Subject(Event(datatype)),
) -> Result(process.Subject(Message), Nil)
pub fn unsubscribe(subscription: process.Subject(Message)) -> Nil
Search Document