freddy alternatives and similar packages
Based on the "Networking" category.
Alternatively, view freddy alternatives based on common mentions on social networks and blogs.
-
call-haskell-from-anything
Call Haskell functions from any programming language via serialization and dynamic libraries -
PortFusion
Haskell-powered cross-platform transport-layer distributed reverse / forward proxy & tunneling solution – currently available for all TCP protocols (RDP, VNC, HTTP(S), SSH, ...). -
ngx-export
A comprehensive web framework aimed at building custom Haskell handlers for the Nginx Web Server
CodeRabbit: AI Code Reviews for Developers
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of freddy or a related project?
README
RabbitMQ Messaging API supporting request-response
Setup
- Create a connection:
import qualified Network.Freddy as Freddy
import qualified Network.Freddy.Request as R
connection <- Freddy.connect "127.0.0.1" "/" "guest" "guest"
Delivering messages
Simple delivery
Send and forget
Sends a message
to the given destination
. If there is no consumer then the
message stays in the queue until somebody consumes it.
Freddy.deliver connection R.newReq {
R.queueName = "notifications.user_signed_in",
R.body = "{\"user_id\": 1}"
}
Expiring messages
Sends a message
to the given destination
. If nobody consumes the message in
timeoutInMs
milliseconds then the message is discarded. This is useful for
showing notifications that must happen in a certain timeframe but guaranteed
delivery is not a strict requirement.
Freddy.deliver connection R.newReq {
R.queueName = "notifications.user_signed_in",
R.body = "{\"user_id\": 1}",
R.timeoutIsMs = 5000
}
Request delivery
Sends a message
to the given destination
. Has a default timeout of 3
seconds and discards the message from the queue if a response hasn't been
returned in that time.
response <- Freddy.deliverWithResponse connection R.newReq {
R.queueName = "echo",
R.body = "{\"msg\": \"what did you say?\"}"
}
case response of
Right payload -> putStrLn "Received positive result"
Left (Freddy.InvalidRequest payload) -> putStrLn "Received error"
Left Freddy.TimeoutError -> putStrLn "Request timed out"
Responding to messages
processMessage (Freddy.Delivery body replyWith failWith) = replyWith body
connection <- Freddy.connect "127.0.0.1" "/" "guest" "guest"
Freddy.respondTo connection "echo" processMessage
Tapping into messages
Listens for messages on a given destination or destinations without consuming them.
processMessage body = putStrLn body
connection <- Freddy.connect "127.0.0.1" "/" "guest" "guest"
Freddy.tapInto connection "notifications.*" processMessage
- Note that it is not possible to respond to the message while tapping.
- When tapping the following wildcards are supported in the
queueName
:#
matching 0 or more words*
matching exactly one word
Examples:
Freddy.tapInto connection "i.#.free" processMessage
receives messages that are delivered to "i.want.to.break.free"
Freddy.tapInto connection "somebody.*.love" processMessage
receives messages that are delivered to somebody.to.love
but doesn't receive messages delivered to someboy.not.to.love