Table of Contents

Interface IShareConsumer<K, V, TJVMK, TJVMV>

Namespace
MASES.KNet.Consumer
Assembly
MASES.KNet.dll

KNet extension of IShareConsumer<K, V>

public interface IShareConsumer<K, V, TJVMK, TJVMV> : IShareConsumer<TJVMK, TJVMV>, ICloseable, IAutoCloseable

Type Parameters

K

The key type

V

The value type

TJVMK

The JVM type of K

TJVMV

The JVM type of V

Inherited Members

Properties

IsCompleting

true if the IShareConsumer<K, V, TJVMK, TJVMV> instance is completing async operation

bool IsCompleting { get; }

Property Value

bool

IsEmpty

true if the IShareConsumer<K, V, TJVMK, TJVMV> instance has an empty set of items in async operation

bool IsEmpty { get; }

Property Value

bool

WaitingMessages

Number of messages in the IShareConsumer<K, V, TJVMK, TJVMV> instance waiting to be processed in async operation

int WaitingMessages { get; }

Property Value

int

Methods

Consume(long, Action<ConsumerRecord<K, V, TJVMK, TJVMV>>)

KNet sync extension for Poll(Duration)

void Consume(long timeoutMs, Action<ConsumerRecord<K, V, TJVMK, TJVMV>> callback)

Parameters

timeoutMs long

Timeout in milliseconds

callback Action<ConsumerRecord<K, V, TJVMK, TJVMV>>

The Action<T> where receives ConsumerRecord<K, V, TJVMK, TJVMV>

ConsumeAsync(long)

KNet async extension for Poll(Duration)

bool ConsumeAsync(long timeoutMs)

Parameters

timeoutMs long

Timeout in milliseconds

Returns

bool

true if something was enqued for Async operations

Poll(TimeSpan)

KNet extension for Poll(Duration)

ConsumerRecords<K, V, TJVMK, TJVMV> Poll(TimeSpan timeout)

Parameters

timeout TimeSpan

Timeout expressed as TimeSpan

Returns

ConsumerRecords<K, V, TJVMK, TJVMV>

ConsumerRecords<K, V, TJVMK, TJVMV>

SetCallback(Action<ConsumerRecord<K, V, TJVMK, TJVMV>>)

Sets the Action<T> to use to receive ConsumerRecord<K, V, TJVMK, TJVMV>

void SetCallback(Action<ConsumerRecord<K, V, TJVMK, TJVMV>> cb)

Parameters

cb Action<ConsumerRecord<K, V, TJVMK, TJVMV>>

The callback Action<T>