Skip to content

Commit b86f06a

Browse files
add IsInvalid property to Handle class (confluentinc#1525)
Co-authored-by: Alexander Volgunin <[email protected]>
1 parent 4783dc1 commit b86f06a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/Confluent.Kafka/Handle.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,14 @@ namespace Confluent.Kafka
2525
/// </summary>
2626
public class Handle
2727
{
28+
/// <summary>
29+
/// Gets a value indicating whether the encapsulated librdkafka handle is invalid.
30+
/// </summary>
31+
/// <value>
32+
/// <b>true</b> if the encapsulated librdkafka handle is invalid; otherwise, <b>false</b>.
33+
/// </value>
34+
public bool IsInvalid => this.LibrdkafkaHandle == null || this.LibrdkafkaHandle.IsInvalid;
35+
2836
internal IClient Owner { get; set; }
2937

3038
internal SafeKafkaHandle LibrdkafkaHandle { get; set; }

0 commit comments

Comments
 (0)