Skip to content

Commit db5ab62

Browse files
authored
Merge branch 'master' into master
2 parents 7efeefa + 2c882f8 commit db5ab62

File tree

13 files changed

+70
-30
lines changed

13 files changed

+70
-30
lines changed

.clj-kondo/config.edn

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{:config-paths ["../resources/clj-kondo.exports/clj-commons/aleph"]}

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44

55
![](docs/aleph.png)
66

7-
Aleph exposes data from the network as a [Manifold](https://github.com/ztellman/manifold) stream, which can easily be transformed into a `java.io.InputStream`, [core.async](https://github.com/clojure/core.async) channel, Clojure sequence, or [many other byte representations](https://github.com/ztellman/byte-streams). It exposes simple default wrappers for HTTP, TCP, and UDP, but allows access to full performance and flexibility of the underlying [Netty](https://github.com/netty/netty) library.
7+
Aleph exposes data from the network as a [Manifold](https://github.com/clj-commons/manifold) stream, which can easily be transformed into a `java.io.InputStream`, [core.async](https://github.com/clojure/core.async) channel, Clojure sequence, or [many other byte representations](https://github.com/clj-commons/byte-streams). It exposes simple default wrappers for HTTP, TCP, and UDP, but allows access to full performance and flexibility of the underlying [Netty](https://github.com/netty/netty) library.
88

99
```clj
10-
[aleph "0.4.6"]
10+
[aleph "0.4.7"]
1111
```
1212

1313
### HTTP
1414

15-
Aleph follows the [Ring](https://github.com/ring-clojure) spec fully, and can be a drop-in replacement for any existing Ring-compliant server. However, it also allows for the handler function to return a [Manifold deferred](https://github.com/ztellman/manifold) to represent an eventual response. This feature may not play nicely with synchronous Ring middleware which modifies the response, but this can be easily fixed by reimplementing the middleware using Manifold's [let-flow](https://github.com/ztellman/manifold/blob/master/docs/deferred.md#let-flow) operator. `aleph.http/wrap-ring-async-handler` helper can be used to covert async 3-arity Ring handler to Aleph-compliant one.
15+
Aleph follows the [Ring](https://github.com/ring-clojure) spec fully, and can be a drop-in replacement for any existing Ring-compliant server. However, it also allows for the handler function to return a [Manifold deferred](https://github.com/clj-commons/manifold) to represent an eventual response. This feature may not play nicely with synchronous Ring middleware which modifies the response, but this can be easily fixed by reimplementing the middleware using Manifold's [let-flow](https://github.com/clj-commons/manifold/blob/master/doc/deferred.md#let-flow) operator. `aleph.http/wrap-ring-async-handler` helper can be used to covert async 3-arity Ring handler to Aleph-compliant one.
1616

1717
```clj
1818
(require '[aleph.http :as http])
@@ -49,21 +49,21 @@ Aleph attempts to mimic the clj-http API and capabilities fully. It supports mul
4949

5050
* proxy configuration should be set for the connection when seting up a connection pool, per-request proxy setups are not allowed
5151

52-
* HTTP proxy functionality is extended with tunneling settings, optional HTTP headers and connection timeout control, see [all configuration keys](https://github.com/ztellman/aleph/blob/d33c76d6c7d1bf9788369fe6fd9d0e56434c8244/src/aleph/http.clj#L122-L132)
52+
* HTTP proxy functionality is extended with tunneling settings, optional HTTP headers and connection timeout control, see [all configuration keys](https://github.com/clj-commons/aleph/blob/d33c76d6c7d1bf9788369fe6fd9d0e56434c8244/src/aleph/http.clj#L122-L132)
5353

5454
* `:proxy-ignore-hosts` is not supported
5555

56-
* both cookies middleware and built-in cookies storages do not support cookie params obsoleted since RFC2965: comment, comment URL, discard, version (see the full structure of the [cookie](https://github.com/ztellman/aleph/blob/d33c76d6c7d1bf9788369fe6fd9d0e56434c8244/src/aleph/http/client_middleware.clj#L645-L655))
56+
* both cookies middleware and built-in cookies storages do not support cookie params obsoleted since RFC2965: comment, comment URL, discard, version (see the full structure of the [cookie](https://github.com/clj-commons/aleph/blob/d33c76d6c7d1bf9788369fe6fd9d0e56434c8244/src/aleph/http/client_middleware.clj#L645-L655))
5757

5858
* when using `:debug`, `:save-request?` and `:debug-body?` options, corresponding requests would be stored in `:aleph/netty-request`, `:aleph/request`, `:aleph/request-body` keys of the response map
5959

6060
* `:response-interceptor` option is not supported
6161

62-
* Aleph introduces `:log-activity` connection pool [configuration](https://github.com/ztellman/aleph/blob/d33c76d6c7d1bf9788369fe6fd9d0e56434c8244/src/aleph/http.clj#L120) to switch on the logging of the connections status changes as well as requests/response hex dumps
62+
* Aleph introduces `:log-activity` connection pool [configuration](https://github.com/clj-commons/aleph/blob/d33c76d6c7d1bf9788369fe6fd9d0e56434c8244/src/aleph/http.clj#L120) to switch on the logging of the connections status changes as well as requests/response hex dumps
6363

6464
* `:cache` and `:cache-config` options are not supported as for now
6565

66-
Aleph client also supports fully async and [highly customizable](https://github.com/ztellman/aleph/blob/d33c76d6c7d1bf9788369fe6fd9d0e56434c8244/src/aleph/netty.clj#L783-L796) DNS resolver.
66+
Aleph client also supports fully async and [highly customizable](https://github.com/clj-commons/aleph/blob/d33c76d6c7d1bf9788369fe6fd9d0e56434c8244/src/aleph/netty.clj#L783-L796) DNS resolver.
6767

6868
To learn more, [read the example code](http://aleph.io/examples/literate.html#aleph.examples.http).
6969

@@ -87,7 +87,7 @@ To learn more, [read the example code](http://aleph.io/examples/literate.html#al
8787

8888
### TCP
8989

90-
A TCP server is similar to an HTTP server, except that for each connection the handler takes two arguments: a duplex stream and a map containing information about the client. The stream will emit byte-arrays, which can be coerced into other byte representations using the [byte-streams](https://github.com/ztellman/byte-streams) library. The stream will accept any messages which can be coerced into a binary representation.
90+
A TCP server is similar to an HTTP server, except that for each connection the handler takes two arguments: a duplex stream and a map containing information about the client. The stream will emit byte-arrays, which can be coerced into other byte representations using the [byte-streams](https://github.com/clj-commons/byte-streams) library. The stream will accept any messages which can be coerced into a binary representation.
9191

9292
An echo TCP server is very similar to the above WebSocket example:
9393

examples/project.clj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
(defproject aleph.examples "0.4.6"
2-
:dependencies [[aleph "0.4.6"]
1+
(defproject aleph.examples "0.4.7"
2+
:dependencies [[aleph "0.4.7"]
33
[gloss "0.2.6"]
44
[compojure "1.6.1"]
55
[org.clojure/clojure "1.9.0"]

examples/src/aleph/examples/http.clj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
;; [Ring spec](https://github.com/ring-clojure/ring/blob/master/SPEC), which means it can be
1818
;; used as a drop-in replacement for pretty much any other Clojure webserver. In order to
1919
;; allow for asynchronous responses, however, it allows for the use of
20-
;; [Manifold](https://github.com/ztellman/manifold) deferreds and streams. Uses of both
20+
;; [Manifold](https://github.com/clj-commons/manifold) deferreds and streams. Uses of both
2121
;; will be illustrated below.
2222

2323
;; Complete documentation for the `aleph.http` namespace can be found [here](http://aleph.io/codox/aleph/aleph.http.html).
@@ -174,7 +174,7 @@
174174
;; that our consumption of the body needs to be synchronous, as shown above by coercing it
175175
;; to a Clojure seq. If we want to have the body be asynchronous, we need to specify
176176
;; `:raw-stream?` to be `true` for request connection pool.
177-
(def raw-stream-connection-pool (http/connection-pool {:connection-options {:raw-stream? true}})
177+
(def raw-stream-connection-pool (http/connection-pool {:connection-options {:raw-stream? true}}))
178178

179179
@(d/chain
180180
(http/get "http://localhost:10000/numbers"

examples/src/aleph/examples/tcp.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
;; ## the basics
1313

14-
;; This uses [Gloss](https://github.com/ztellman/gloss), which is a library for defining byte
14+
;; This uses [Gloss](https://github.com/clj-commons/gloss), which is a library for defining byte
1515
;; formats, which are automatically compiled into encoder and streaming decoders.
1616
;;
1717
;; Here, we define a simple protocol where each frame starts with a 32-bit integer describing

project.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
[org.clj-commons/byte-streams "0.2.10"]
1717
[potemkin "0.4.5"]])
1818

19-
(defproject aleph "0.4.7-rc3"
19+
(defproject aleph "0.4.7"
2020
:description "A framework for asynchronous communication"
2121
:repositories {"jboss" "https://repository.jboss.org/nexus/content/groups/public/"
2222
"sonatype-oss-public" "https://oss.sonatype.org/content/groups/public/"}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
(ns aleph.clj-kondo-hooks)
2+
3+
(defmacro def-http-method [method]
4+
`(defn ~method
5+
([url#])
6+
([url# options#])))
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{:hooks {:macroexpand {aleph.http/def-http-method aleph.clj-kondo-hooks/def-http-method}}}

src/aleph/flow.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
TimeUnit]))
2727

2828
(defn instrumented-pool
29-
"Returns a [Dirigiste](https://github.com/ztellman/dirigiste) object pool, which can be interacted
29+
"Returns a [Dirigiste](https://github.com/clj-commons/dirigiste) object pool, which can be interacted
3030
with via `acquire`, `release`, and `dispose`.
3131
3232
|:---|:----

src/aleph/http.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@
413413
| `pool` | the `connection-pool` that should be used, defaults to the `default-connection-pool`
414414
| `middleware` | any additional middleware that should be used for handling requests and responses
415415
| `headers` | the HTTP headers for the request
416-
| `body` | an optional body, which should be coercable to a byte representation via [byte-streams](https://github.com/ztellman/byte-streams)
416+
| `body` | an optional body, which should be coercable to a byte representation via [byte-streams](https://github.com/clj-commons/byte-streams)
417417
| `multipart` | a vector of bodies")
418418
:arglists arglists)))
419419

0 commit comments

Comments
 (0)