From 025bce91b4ea67e0510bca687eac62473592d90e Mon Sep 17 00:00:00 2001 From: Mandar Chitre Date: Sat, 13 Jan 2024 12:51:13 +0800 Subject: [PATCH 1/2] feat: allow non-string host (e.g. IPv4) --- src/gw.jl | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/gw.jl b/src/gw.jl index 4cac869..e1c5350 100644 --- a/src/gw.jl +++ b/src/gw.jl @@ -11,15 +11,13 @@ struct Gateway sock::Ref{TCPSocket} subscriptions::Set{String} pending::Dict{String,Channel} - msgqueue::Vector tasks_waiting_for_msg::Vector{Tuple{Task,#=receive_id::=#Int}} msgqueue_lock::ReentrantLock # Protects both msgqueue and tasks_waiting_for_msg - host::String port::Int reconnect::Ref{Bool} - function Gateway(name::String, host::String, port::Int; reconnect=true) + function Gateway(name::String, host, port::Int; reconnect=true) gw = new( AgentID(name, false), Ref(connect(host, port)), @@ -28,14 +26,14 @@ struct Gateway Vector(), Vector{Tuple{Task,Int}}(), ReentrantLock(), - host, port, Ref(reconnect) + string(host), port, Ref(reconnect) ) @async _run(gw) gw end end -Gateway(host::String, port::Int; reconnect=true) = Gateway("julia-gw-" * string(uuid1()), host, port; reconnect=reconnect) +Gateway(host, port::Int; reconnect=true) = Gateway("julia-gw-" * string(uuid1()), host, port; reconnect=reconnect) Base.show(io::IO, gw::Gateway) = print(io, gw.agentID.name) From a896c488fa5230c08bdebcd01f68beecae4ded4d Mon Sep 17 00:00:00 2001 From: Mandar Chitre Date: Sat, 13 Jan 2024 13:03:26 +0800 Subject: [PATCH 2/2] fix: fix broken test suite --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index d687aac..5d83c2f 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.github.org-arl Fjage.jl - 0.2.0-SNAPSHOT + 0.1.0 snapshots @@ -14,7 +14,7 @@ com.github.org-arl fjage - 1.10.0-SNAPSHOT + 1.12.2