1module Kafka.Transaction
13import Control.Promise (Promise, toAffE)
14import Data.Function.Uncurried (Fn2, runFn2)
16import Effect.Aff (Aff)
17import Kafka.Consumer (GroupId)
18import Kafka.Producer (InternalProducerBatch, Producer, ProducerBatch, RecordMetadata, toInternalProducerBatch)
19import Kafka.Types (Offset, Partition, Topic)
20import Prelude (Unit, (#), (>>>))
22foreign import data Transaction :: Type
24foreign import transactionImpl :: Producer -> Effect (Promise Transaction)
26transaction :: Producer -> Aff Transaction
27transaction = transactionImpl >>> toAffE
29type PartitionCommit = {
30 partition:: Partition,
36 partitions :: Array PartitionCommit
40 consumerGroupId :: GroupId,
41 topics :: Array TopicCommit
44foreign import sendOffsetsImpl :: Fn2 Transaction SendOffsets (Effect (Promise Unit))
46sendOffsets :: Transaction -> SendOffsets -> Aff Unit
47sendOffsets t so = runFn2 sendOffsetsImpl t so # toAffE
49foreign import sendImpl :: Fn2 Transaction InternalProducerBatch (Effect (Promise (Array RecordMetadata)))
51send :: Transaction -> ProducerBatch -> Aff (Array RecordMetadata)
52send t pl = runFn2 sendImpl t (toInternalProducerBatch pl) # toAffE
54foreign import commitImpl :: Transaction -> Effect (Promise Unit)
56commit :: Transaction -> Aff Unit
57commit = commitImpl >>> toAffE
59foreign import abortImpl :: Transaction -> Effect (Promise Unit)
61abort :: Transaction -> Aff Unit
62abort = abortImpl >>> toAffE
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list