Skip to content

Commit

Permalink
Fixed some warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Lanayx committed Sep 25, 2023
1 parent 3afeab2 commit 67f5a8b
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 36 deletions.
3 changes: 0 additions & 3 deletions examples/FsharpExamples/FsharpExamples.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,5 @@
<ProjectReference Include="..\..\src\Pulsar.Client.Proto\Pulsar.Client.Proto.csproj" />
<ProjectReference Include="..\..\src\Pulsar.Client\Pulsar.Client.fsproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="7.0.0" />
</ItemGroup>
<Import Project="..\..\.paket\Paket.Restore.targets" />
</Project>
4 changes: 2 additions & 2 deletions examples/FsharpExamples/paket.references
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
group Examples
FSharp.Core
Microsoft.Extensions.Logging.Console
OpenTelemetry.Exporter.Console
OpenTelemetry
OpenTelemetry
Microsoft.Extensions.Logging.Console
32 changes: 22 additions & 10 deletions paket.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ STORAGE: NONE
RESTRICTION: == netstandard2.0
NUGET
remote: https://api.nuget.org/v3/index.json
Apache.Avro (1.11.2)
Apache.Avro (1.11.3)
Newtonsoft.Json (>= 10.0.3)
System.CodeDom (>= 7.0)
AvroSchemaGenerator (2.9.2)
Expand Down Expand Up @@ -129,7 +129,7 @@ STORAGE: NONE
RESTRICTION: == net8.0
NUGET
remote: https://api.nuget.org/v3/index.json
Apache.Avro (1.11.2)
Apache.Avro (1.11.3)
Newtonsoft.Json (>= 10.0.3)
System.CodeDom (>= 7.0)
AvroSchemaGenerator (2.9.2)
Expand Down Expand Up @@ -160,6 +160,11 @@ NUGET
Microsoft.Extensions.DependencyInjection (7.0)
Microsoft.Extensions.DependencyInjection.Abstractions (>= 7.0)
Microsoft.Extensions.DependencyInjection.Abstractions (7.0)
Microsoft.Extensions.Http (7.0)
Microsoft.Extensions.DependencyInjection.Abstractions (>= 7.0)
Microsoft.Extensions.Logging (>= 7.0)
Microsoft.Extensions.Logging.Abstractions (>= 7.0)
Microsoft.Extensions.Options (>= 7.0)
Microsoft.Extensions.Logging (7.0)
Microsoft.Extensions.DependencyInjection (>= 7.0)
Microsoft.Extensions.DependencyInjection.Abstractions (>= 7.0)
Expand Down Expand Up @@ -222,14 +227,15 @@ NUGET
System.Collections.Immutable (>= 7.0)
protobuf-net.Reflection (3.2.12)
protobuf-net.Core (>= 3.2.12)
Pulsar.Client (2.12.7)
Pulsar.Client (2.13)
Apache.Avro (>= 1.11.2)
AvroSchemaGenerator (>= 2.9.2)
FSharp.Core (>= 7.0.300)
FSharp.Core (>= 7.0.400)
FSharp.UMX (>= 1.1)
K4os.Compression.LZ4 (>= 1.3.5)
K4os.Compression.LZ4 (>= 1.3.6)
Microsoft.Bcl.AsyncInterfaces (>= 7.0)
Microsoft.Extensions.Caching.Memory (>= 7.0)
Microsoft.Extensions.Http (>= 7.0)
Microsoft.Extensions.Logging (>= 7.0)
Microsoft.Extensions.Logging.Abstractions (>= 7.0.1)
Microsoft.IO.RecyclableMemoryStream (>= 2.3.2)
Expand Down Expand Up @@ -270,7 +276,7 @@ STORAGE: NONE
RESTRICTION: == netstandard2.0
NUGET
remote: https://api.nuget.org/v3/index.json
Apache.Avro (1.11.2)
Apache.Avro (1.11.3)
Newtonsoft.Json (>= 10.0.3)
System.CodeDom (>= 7.0)
AvroSchemaGenerator (2.9.2)
Expand Down Expand Up @@ -308,6 +314,11 @@ NUGET
Microsoft.Extensions.DependencyInjection.Abstractions (7.0)
Microsoft.Bcl.AsyncInterfaces (>= 7.0)
System.Threading.Tasks.Extensions (>= 4.5.4)
Microsoft.Extensions.Http (7.0)
Microsoft.Extensions.DependencyInjection.Abstractions (>= 7.0)
Microsoft.Extensions.Logging (>= 7.0)
Microsoft.Extensions.Logging.Abstractions (>= 7.0)
Microsoft.Extensions.Options (>= 7.0)
Microsoft.Extensions.Logging (7.0)
Microsoft.Bcl.AsyncInterfaces (>= 7.0)
Microsoft.Extensions.DependencyInjection (>= 7.0)
Expand Down Expand Up @@ -374,14 +385,15 @@ NUGET
System.Memory (>= 4.5.5)
protobuf-net.Reflection (3.2.12)
protobuf-net.Core (>= 3.2.12)
Pulsar.Client (2.12.7)
Pulsar.Client (2.13)
Apache.Avro (>= 1.11.2)
AvroSchemaGenerator (>= 2.9.2)
FSharp.Core (>= 7.0.300)
FSharp.Core (>= 7.0.400)
FSharp.UMX (>= 1.1)
K4os.Compression.LZ4 (>= 1.3.5)
K4os.Compression.LZ4 (>= 1.3.6)
Microsoft.Bcl.AsyncInterfaces (>= 7.0)
Microsoft.Extensions.Caching.Memory (>= 7.0)
Microsoft.Extensions.Http (>= 7.0)
Microsoft.Extensions.Logging (>= 7.0)
Microsoft.Extensions.Logging.Abstractions (>= 7.0.1)
Microsoft.IO.RecyclableMemoryStream (>= 2.3.2)
Expand Down Expand Up @@ -447,7 +459,7 @@ STORAGE: NONE
RESTRICTION: == net7.0
NUGET
remote: https://api.nuget.org/v3/index.json
Apache.Avro (1.11.2)
Apache.Avro (1.11.3)
Newtonsoft.Json (>= 10.0.3)
System.CodeDom (>= 7.0)
Expecto (10.1)
Expand Down
30 changes: 18 additions & 12 deletions src/Pulsar.Client/Internal/BinaryLookupService.fs
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,12 @@ type internal BinaryLookupService (config: PulsarClientConfiguration, connection

member this.GetPartitionedTopicMetadata topicName =
backgroundTask {
let backoff = Backoff { BackoffConfig.Default with
Initial = TimeSpan.FromMilliseconds(100.0)
MandatoryStop = (config.OperationTimeout + config.OperationTimeout)
Max = TimeSpan.FromMinutes(1.0) }
let backoff =
Backoff {
Initial = TimeSpan.FromMilliseconds(100.0)
MandatoryStop = config.OperationTimeout + config.OperationTimeout
Max = TimeSpan.FromMinutes(1.0)
}
let! result = this.GetPartitionedTopicMetadataInner(topicName, backoff, int config.OperationTimeout.TotalMilliseconds)
return result
}
Expand Down Expand Up @@ -112,10 +114,12 @@ type internal BinaryLookupService (config: PulsarClientConfiguration, connection

member this.GetTopicsUnderNamespace (ns : NamespaceName, isPersistent : bool) =
backgroundTask {
let backoff = Backoff { BackoffConfig.Default with
Initial = TimeSpan.FromMilliseconds(100.0)
MandatoryStop = (config.OperationTimeout + config.OperationTimeout)
Max = TimeSpan.FromMinutes(1.0) }
let backoff =
Backoff {
Initial = TimeSpan.FromMilliseconds(100.0)
MandatoryStop = config.OperationTimeout + config.OperationTimeout
Max = TimeSpan.FromMinutes(1.0)
}
let! result = this.GetTopicsUnderNamespaceInner(ns, backoff, int config.OperationTimeout.TotalMilliseconds, isPersistent)
return result
}
Expand Down Expand Up @@ -146,10 +150,12 @@ type internal BinaryLookupService (config: PulsarClientConfiguration, connection

member this.GetSchema(topicName: CompleteTopicName, ?schemaVersion: SchemaVersion) =
backgroundTask {
let backoff = Backoff { BackoffConfig.Default with
Initial = TimeSpan.FromMilliseconds(100.0)
MandatoryStop = (config.OperationTimeout + config.OperationTimeout)
Max = TimeSpan.FromMinutes(1.0) }
let backoff =
Backoff {
Initial = TimeSpan.FromMilliseconds(100.0)
MandatoryStop = config.OperationTimeout + config.OperationTimeout
Max = TimeSpan.FromMinutes(1.0)
}
let! result = this.GetSchemaInner(topicName, schemaVersion, backoff, int config.OperationTimeout.TotalMilliseconds)
return result
}
Expand Down
2 changes: 1 addition & 1 deletion src/Pulsar.Client/Internal/MultiTopicsConsumerImpl.fs
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ type internal MultiTopicsConsumerImpl<'T> (consumerConfig: ConsumerConfiguration
{
consumerInitInfo with
Metadata = {
consumerInitInfo.Metadata with Partitions = newPartitionsCount
Partitions = newPartitionsCount
}
}
let newConsumerTasks =
Expand Down
12 changes: 6 additions & 6 deletions src/Pulsar.Client/Internal/ProducerImpl.fs
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ type internal ProducerImpl<'T> private (producerConfig: ProducerConfiguration, c
producerConfig.Topic.CompleteTopicName,
(fun epoch -> post this.Mb (ProducerMessage.ConnectionOpened epoch)),
(fun ex -> post this.Mb (ProducerMessage.ConnectionFailed ex)),
Backoff { BackoffConfig.Default with
Initial = clientConfig.InitialBackoffInterval
Max = clientConfig.MaxBackoffInterval
MandatoryStop = TimeSpan.FromMilliseconds(Math.Max(100.0, sendTimeoutMs - 100.0))})
Backoff {
Initial = clientConfig.InitialBackoffInterval
Max = clientConfig.MaxBackoffInterval
MandatoryStop = TimeSpan.FromMilliseconds(Math.Max(100.0, sendTimeoutMs - 100.0))})

let batchMessageContainer =
match producerConfig.BatchBuilder with
Expand Down Expand Up @@ -607,7 +607,7 @@ type internal ProducerImpl<'T> private (producerConfig: ProducerConfiguration, c
let msgId =
match chunkDetailsOption with
| Some chunkDetail ->
chunkDetail.MessageIds.[chunkDetail.ChunkId] <- currentMessageId
chunkDetail.MessageIds[chunkDetail.ChunkId] <- currentMessageId
{ currentMessageId with ChunkMessageIds = Some chunkDetail.MessageIds }
| None ->
currentMessageId
Expand All @@ -620,7 +620,7 @@ type internal ProducerImpl<'T> private (producerConfig: ProducerConfiguration, c
let currentMsgId =
{ LedgerId = receipt.LedgerId; EntryId = receipt.EntryId; Partition = partitionIndex;
Type = MessageIdType.Single; TopicName = %""; ChunkMessageIds = None }
chunkDetails.MessageIds.[chunkDetails.ChunkId] <- currentMsgId
chunkDetails.MessageIds[chunkDetails.ChunkId] <- currentMsgId

| BatchCallbacks tcss ->
tcss
Expand Down
3 changes: 1 addition & 2 deletions src/Pulsar.Client/Transaction/TransactionBuilder.fs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ type TransactionBuilder internal (transactionClient: TransactionCoordinatorClien


member this.TransactionTimeout transactionTimeout =
{ config with
TxnTimeout = transactionTimeout }
{ TxnTimeout = transactionTimeout }
|> this.With

member this.BuildAsync() =
Expand Down

0 comments on commit 67f5a8b

Please sign in to comment.