franz/producers
Types
pub type Partitioner {
PartitionFun(
fn(String, Int, BitArray, BitArray) -> Result(Int, Nil),
)
Random
Hash
}
Constructors
-
PartitionFun( fn(String, Int, BitArray, BitArray) -> Result(Int, Nil), )
-
Random
-
Hash
pub type ProducerPartition {
Partition(Int)
Partitioner(Partitioner)
}
Constructors
-
Partition(Int)
-
Partitioner(Partitioner)
pub type Value {
Value(value: BitArray, headers: List(#(String, String)))
ValueWithTimestamp(
value: BitArray,
timestamp: Int,
headers: List(#(String, String)),
)
}
Constructors
-
Value(value: BitArray, headers: List(#(String, String)))
-
ValueWithTimestamp( value: BitArray, timestamp: Int, headers: List(#(String, String)), )
Functions
pub fn produce(
client: FranzClient,
topic: String,
partition: ProducerPartition,
key: BitArray,
value: Value,
) -> Result(Nil, FranzError)
pub fn produce_cb(
client: FranzClient,
topic: String,
partition: ProducerPartition,
key: BitArray,
value: Value,
callback: fn(Int, Int) -> a,
) -> Result(Int, FranzError)
pub fn produce_sync(
client: FranzClient,
topic: String,
partition: ProducerPartition,
key: BitArray,
value: Value,
) -> Result(Nil, FranzError)
pub fn produce_sync_offset(
client: FranzClient,
topic: String,
partition: ProducerPartition,
key: BitArray,
value: Value,
) -> Result(Int, FranzError)