-
Notifications
You must be signed in to change notification settings - Fork 4
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
Showing
4 changed files
with
31 additions
and
4 deletions.
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,19 @@ | ||
(ns plasma.remote) | ||
|
||
(defn- url-map [url] | ||
(let [match (re-find #"(.*)://([0-9a-zA-Z-_.]*)(:([0-9]+))?(.*)" url) | ||
[_ proto host _ port path] match] | ||
{:proto proto | ||
:host host | ||
:port (if port | ||
(Integer. port) | ||
nil) | ||
:path path})) | ||
|
||
(defmulti remote-query-fn | ||
"Given a URL, return a function that accepts a query plan and returns a query channel | ||
onto which the results will be enqueued. This is the mechanism used to traverse | ||
from one graph to another, possibly over the network. Dispatch is based on the | ||
protocol as a keyword (e.g. :http, :plasma, :jiraph, etc...)" | ||
(fn [url] | ||
(keyword (:proto (url-map url))))) |
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