Skip to content

Commit

Permalink
Merge pull request #22 from jakubwro/jakubwro/adding-compat
Browse files Browse the repository at this point in the history
Jakubwro/adding compat
  • Loading branch information
jakubwro authored Sep 21, 2024
2 parents e6fc960 + b2047b0 commit 31685a3
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 74 deletions.
86 changes: 20 additions & 66 deletions Manifest.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# This file is machine-generated - editing it directly is not advised

julia_version = "1.10.4"
julia_version = "1.10.5"
manifest_format = "2.0"
project_hash = "4ab6eda5f824f8b041ec111713189b95c640f8fd"
project_hash = "df31546dc2fa8253b1817fff6736fa1d96f9c168"

[[deps.ArgTools]]
uuid = "0dad84c5-d112-42e6-8d28-ef12dabb789f"
Expand All @@ -15,30 +15,20 @@ uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33"
uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"

[[deps.BufferedStreams]]
git-tree-sha1 = "4ae47f9a4b1dc19897d3743ff13685925c5202ec"
git-tree-sha1 = "6863c5b7fc997eadcabdbaf6c5f201dc30032643"
uuid = "e1450e63-4bb3-523b-b2a4-4ffa8c0fd77d"
version = "1.2.1"

[[deps.CodeTracking]]
deps = ["InteractiveUtils", "UUIDs"]
git-tree-sha1 = "c0216e792f518b39b22212127d4a84dc31e4e386"
uuid = "da1fd8a2-8d9e-5ec2-8556-3022fb5608a2"
version = "1.3.5"
version = "1.2.2"

[[deps.CodecBase]]
deps = ["TranscodingStreams"]
git-tree-sha1 = "5f984d989ae8ebf5d43290cfba36a24b35fb91e9"
git-tree-sha1 = "40956acdbef3d8c7cc38cba42b56034af8f8581a"
uuid = "6c391c72-fb7b-5838-ba82-7cfb1bcfecbf"
version = "0.3.1"
version = "0.3.4"

[[deps.Dates]]
deps = ["Printf"]
uuid = "ade2ca70-3891-5945-98fb-dc099432e06a"

[[deps.Distributed]]
deps = ["Random", "Serialization", "Sockets"]
uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b"

[[deps.DocStringExtensions]]
deps = ["LibGit2"]
git-tree-sha1 = "2fb1e02f2b635d0845df5d7c167fec4dd739b00d"
Expand All @@ -64,9 +54,9 @@ uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240"

[[deps.JLLWrappers]]
deps = ["Artifacts", "Preferences"]
git-tree-sha1 = "7e5d6779a1e09a36db2a7b6cff50942a0a7d0fca"
git-tree-sha1 = "f389674c99bfcde17dc57454011aa44d5a260a40"
uuid = "692b3bcd-3c85-4b1f-b108-f13ce0eb3210"
version = "1.5.0"
version = "1.6.0"

[[deps.JSON3]]
deps = ["Dates", "Mmap", "Parsers", "PrecompileTools", "StructTypes", "UUIDs"]
Expand All @@ -80,12 +70,6 @@ version = "1.14.0"
[deps.JSON3.weakdeps]
ArrowTypes = "31f734f8-188a-4ce0-8406-c8a06bd891cd"

[[deps.JuliaInterpreter]]
deps = ["CodeTracking", "InteractiveUtils", "Random", "UUIDs"]
git-tree-sha1 = "e49bce680c109bc86e3e75ebcb15040d6ad9e1d3"
uuid = "aa1ae85d-cabe-5617-a682-6adf51b2e16a"
version = "0.9.27"

[[deps.LibCURL]]
deps = ["LibCURL_jll", "MozillaCACerts_jll"]
uuid = "b27032c2-a3e7-50c8-80cd-2d36dbcbfd21"
Expand Down Expand Up @@ -116,12 +100,6 @@ uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
[[deps.Logging]]
uuid = "56ddb016-857b-54e1-b83d-db4d58db5568"

[[deps.LoweredCodeUtils]]
deps = ["JuliaInterpreter"]
git-tree-sha1 = "38756922d32476c8f41f73560b910fc805a5a103"
uuid = "6f1432cf-f94c-5a45-995e-cdbf5db27b0b"
version = "2.4.3"

[[deps.Markdown]]
deps = ["Base64"]
uuid = "d6f4376e-aef5-505a-96c1-9c027394607a"
Expand All @@ -146,19 +124,14 @@ version = "2023.1.10"

[[deps.NanoDates]]
deps = ["Dates", "Parsers"]
git-tree-sha1 = "22a4727a7e24fa9024dc8331b40ccf8a70f922c3"
git-tree-sha1 = "850a0557ae5934f6e67ac0dc5ca13d0328422d1f"
uuid = "46f1a544-deae-4307-8689-c12aa3c955c6"
version = "1.0.2"
version = "1.0.3"

[[deps.NetworkOptions]]
uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908"
version = "1.2.0"

[[deps.OrderedCollections]]
git-tree-sha1 = "dfdf5519f235516220579f949664f1bf44e741c5"
uuid = "bac558e1-5e72-5ebc-8fee-abe8a469f55d"
version = "1.6.3"

[[deps.Parsers]]
deps = ["Dates", "PrecompileTools", "UUIDs"]
git-tree-sha1 = "8489905bcdbcfac64d1daa51ca07c0d8f0283821"
Expand All @@ -172,15 +145,15 @@ version = "1.10.0"

[[deps.PrecompileTools]]
deps = ["Preferences"]
git-tree-sha1 = "03b4c25b43cb84cee5c90aa9b5ea0a78fd848d2f"
git-tree-sha1 = "5aa36f7049a63a1528fe8f7c3f2113413ffd4e1f"
uuid = "aea7be01-6a6a-4083-8856-8a6e6704d82a"
version = "1.2.0"
version = "1.2.1"

[[deps.Preferences]]
deps = ["TOML"]
git-tree-sha1 = "00805cd429dcb4870060ff49ef443486c262e38e"
git-tree-sha1 = "9306f6085165d270f7e3db02af26a400d580f5c6"
uuid = "21216c6a-2e73-6563-6e65-726566657250"
version = "1.4.1"
version = "1.4.3"

[[deps.Printf]]
deps = ["Unicode"]
Expand All @@ -194,27 +167,15 @@ uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"
deps = ["SHA"]
uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"

[[deps.Requires]]
deps = ["UUIDs"]
git-tree-sha1 = "838a3a4188e2ded87a4f9f184b4b0d78a1e91cb7"
uuid = "ae029012-a4dd-5104-9daa-d747884805df"
version = "1.3.0"

[[deps.Revise]]
deps = ["CodeTracking", "Distributed", "FileWatching", "JuliaInterpreter", "LibGit2", "LoweredCodeUtils", "OrderedCollections", "Pkg", "REPL", "Requires", "UUIDs", "Unicode"]
git-tree-sha1 = "116d71e489abc472efa460cfa2bc0ac7cd0bab54"
uuid = "295af30f-e4ad-537b-8983-00126c2a3abe"
version = "3.5.12"

[[deps.SHA]]
uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce"
version = "0.7.0"

[[deps.ScopedValues]]
deps = ["HashArrayMappedTries", "Logging"]
git-tree-sha1 = "c27d546a4749c81f70d1fabd604da6aa5054e3d2"
git-tree-sha1 = "eef2fbac9538ee6cc60ee1489f028d2f8a1a5249"
uuid = "7e506255-f358-4e82-b7e4-beb19740aa63"
version = "1.2.0"
version = "1.2.1"

[[deps.Serialization]]
uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b"
Expand All @@ -230,9 +191,9 @@ version = "1.1.2"

[[deps.StructTypes]]
deps = ["Dates", "UUIDs"]
git-tree-sha1 = "ca4bccb03acf9faaf4137a9abc1881ed1841aa70"
git-tree-sha1 = "159331b30e94d7b11379037feeb9b690950cace8"
uuid = "856f2bd8-1eba-4b0a-8007-ebc267875bd4"
version = "1.10.0"
version = "1.11.0"

[[deps.TOML]]
deps = ["Dates"]
Expand All @@ -245,16 +206,9 @@ uuid = "a4e569a6-e804-4fa4-b0f3-eef7a1d5b13e"
version = "1.10.0"

[[deps.TranscodingStreams]]
git-tree-sha1 = "1fbeaaca45801b4ba17c251dd8603ef24801dd84"
git-tree-sha1 = "e84b3a11b9bece70d14cce63406bbc79ed3464d2"
uuid = "3bb67fe8-82b1-5028-8e26-92a6c54297fa"
version = "0.10.2"

[deps.TranscodingStreams.extensions]
TestExt = ["Test", "Random"]

[deps.TranscodingStreams.weakdeps]
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
version = "0.11.2"

[[deps.URIs]]
git-tree-sha1 = "67db6cc7b3821e19ebe75791a9dd19c9b1188f2b"
Expand Down
14 changes: 13 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,25 @@ JSON3 = "0f8b85d8-7281-11e9-16c2-39a750bddbf1"
MbedTLS = "739be429-bea8-5141-9913-cc70e7f3736d"
NanoDates = "46f1a544-deae-4307-8689-c12aa3c955c6"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Revise = "295af30f-e4ad-537b-8983-00126c2a3abe"
ScopedValues = "7e506255-f358-4e82-b7e4-beb19740aa63"
Sockets = "6462fe0b-24de-5631-8697-dd941f90decc"
Sodium = "4f5b5e99-b0ad-42cd-b47a-334e172ec8bd"
StructTypes = "856f2bd8-1eba-4b0a-8007-ebc267875bd4"
URIs = "5c2747f8-b7ea-4ff2-ba2e-563bfd36b1d4"

[compat]
BufferedStreams = "1.2.2"
CodecBase = "0.3.4"
DocStringExtensions = "0.9.3"
JSON3 = "1.14.0"
MbedTLS = "1.1.9"
NanoDates = "1.0.3"
ScopedValues = "1.2.1"
Sodium = "1.1.2"
StructTypes = "1.11.0"
URIs = "1.5.1"
julia = "1.10"

[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

Expand Down
4 changes: 1 addition & 3 deletions src/NATS.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

module NATS

using Revise
using Random
using Sockets
using StructTypes
Expand Down Expand Up @@ -64,14 +63,13 @@ const DEFAULT_MAX_PINGS_OUT = 2
const DEFAULT_RETRY_ON_INIT_FAIL = false
const DEFAULT_IGNORE_ADVERTISED_SERVERS = false
const DEFAULT_RETAIN_SERVERS_ORDER = false
const DEFAULT_ENQUEUE_WHEN_DISCONNECTED = true
const DEFAULT_ENQUEUE_WHEN_DISCONNECTED = true # If set to true messages will be enqueued when connection lost, otherwise exception will be thrown.
const DEFAULT_SUBSCRIPTION_CHANNEL_SIZE = 512 * 1024
const DEFAULT_SUBSCRIPTION_ERROR_THROTTLING_SECONDS = 5.0
const DEFAULT_REQUEST_TIMEOUT_SECONDS = 5.0
const DEFAULT_DRAIN_TIMEOUT_SECONDS = 5.0
const DEFAULT_DRAIN_POLL_INTERVAL_SECONDS = 0.2

# If set to true messages will be enqueued when connection lost, otherwise exception will be thrown.
const INVOKE_LATEST_CONVERSIONS = false # TODO: use this in code

include("protocol/protocol.jl")
Expand Down
8 changes: 4 additions & 4 deletions src/pubsub/subscribe.jl
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,8 @@ $(SIGNATURES)
Obtains batch of messages for synchronous subscription.
Optional keyword arguments:
- `no_wait`: do not wait for next message, return `nothing` if buffer is empty
- `no_throw`: do not throw exception, returns `nothing` if cannot get next message
- `no_wait`: do not wait for next message, return empty vector if buffer is empty
- `no_throw`: do not throw exception, stops collecting messages on error
"""
function next(connection::Connection, sub::Sub, batch::Integer; no_wait = false, no_throw = false)::Vector{Msg}
msgs = []
Expand All @@ -187,8 +187,8 @@ $(SIGNATURES)
Obtains batch of messages for synchronous subscription converting them to reqested `T` type.
Optional keyword arguments:
- `no_wait`: do not wait for next message, return `nothing` if buffer is empty
- `no_throw`: do not throw exception, returns `nothing` if cannot get next message
- `no_wait`: do not wait for next message, return empty vector if buffer is empty
- `no_throw`: do not throw exception, stops collecting messages on error
"""
function next(T::Type, connection::Connection, sub::Sub, batch::Integer; no_wait = false, no_throw = false)::Vector{T}
find_msg_conversion_or_throw(T)
Expand Down

2 comments on commit 31685a3

@jakubwro
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request updated: JuliaRegistries/General/115613

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.1.0 -m "<description of version>" 31685a3b3296e2c3285a1c5e0b09b7a6572c8c2e
git push origin v0.1.0

Please sign in to comment.