Skip to content

Commit

Permalink
populate DEFAULT_BACKEND in __init__
Browse files Browse the repository at this point in the history
  • Loading branch information
ericphanson committed Jul 19, 2021
1 parent d4f0f3c commit 4760f18
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/AWS.jl
Original file line number Diff line number Diff line change
Expand Up @@ -353,4 +353,9 @@ function (service::RestJSONService)(
return submit_request(aws_config, request; return_headers=return_headers)
end

function __init__()
DEFAULT_BACKEND[] = HTTPBackend()
return nothing
end

end # module AWS
3 changes: 2 additions & 1 deletion src/utilities/request.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ function HTTPBackend(; kwargs...)
isempty(kwargs) ? HTTPBackend(LittleDict{Symbol, Any}()) : HTTPBackend(LittleDict(kwargs))
end

const DEFAULT_BACKEND = Ref{AbstractBackend}(HTTPBackend())
# populated in `__init__`
const DEFAULT_BACKEND = Ref{AbstractBackend}()

Base.@kwdef mutable struct Request
service::String
Expand Down

0 comments on commit 4760f18

Please sign in to comment.