-
Notifications
You must be signed in to change notification settings - Fork 183
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b7f5aa8
commit 86fb137
Showing
3 changed files
with
32 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using PrecompileTools: @setup_workload, @compile_workload | ||
|
||
@setup_workload begin | ||
# TODO: Are these all safe to call here and bake into the pkgimage? | ||
Connections.__init__() | ||
MultiPartParsing.__init__() | ||
Parsers.__init__() | ||
ConnectionRequest.__init__() | ||
|
||
gzip_data(data::String) = read(GzipCompressorStream(IOBuffer(data))) | ||
|
||
# random port in the dynamic/private range (49152–65535) which are are | ||
# least likely to be used by well-known services | ||
_port = 57813 | ||
|
||
server = HTTP.serve!("0.0.0.0", _port; verbose = -1) do req | ||
HTTP.Response(200, ["Content-Encoding" => "gzip"], gzip_data("dummy response")) | ||
end | ||
@compile_workload begin | ||
HTTP.get("http://localhost:$_port") | ||
end | ||
HTTP.forceclose(server) | ||
server = nothing | ||
end |