Skip to main content

pamoja_ladder_subscribe

Function pamoja_ladder_subscribe 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn pamoja_ladder_subscribe( ladder: *mut PamojaLadder, topic: *const c_char, ) -> PamojaStatus
Expand description

Subscribes every rung that listens to a topic.

The filter is kept for the life of the ladder, so a rung that is down when it is placed receives it when it next connects. Subscribing while no rung is up succeeds, the way a send with no rung up is buffered rather than refused.

§Arguments

  • ladder - the ladder.
  • topic - the topic filter, as null-terminated UTF-8.

§Returns

PamojaStatus::Ok once the filter is live on a rung or held for the next connect, or the status of the refusal if every connected rung refused it.

§Safety

ladder must be a live handle and topic a valid null-terminated UTF-8 string.