Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
clj-util-message-server/src/main/clojure/de/mpg/shh/util_message_server/helpers.clj
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
17 lines (16 sloc)
898 Bytes
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
(ns de.mpg.shh.util-message-server.helpers | |
(:require [clojure.tools.logging :refer [info error]] | |
[clojure.core.async :as async])) | |
(defn synch-send | |
[request-channel host port username password address msg & {:keys [properties encoding timeout result-channel] :or {properties nil encoding :edn timeout 1000 result-channel (async/chan 1)}}] | |
(async/>!! request-channel {:msg msg | |
:properties properties | |
:encoding encoding | |
:command :send | |
:host host | |
:port port | |
:username username | |
:password password | |
:address address | |
:result-channel result-channel}) | |
(first (async/alts!! [(async/timeout timeout) result-channel]))) |