Liking cljdoc? Tell your friends :D

teensyp.stream

A namespace of utility functions for integrating streams into Teensyp.

A namespace of utility functions for integrating streams into Teensyp.
raw docstring

input-streamclj

(input-stream readf)
(input-stream readf closef)

Create an InputStream from a read and optional close function. The read function maps to the .read method on the InputStream class and takes 3 arguments: a byte array to receive the data, an offset and a length. The read function should return the number of bytes read, or -1 if the stream is closed. The close function maps to the .close method and takes zero arguments.

Create an InputStream from a read and optional close function. The read
function maps to the `.read` method on the InputStream class and takes 3
arguments: a byte array to receive the data, an offset and a length. The read
function should return the number of bytes read, or -1 if the stream is
closed. The close function maps to the `.close` method and takes zero
arguments.
sourceraw docstring

output-streamclj

(output-stream writef)
(output-stream writef closef)
(output-stream writef closef flushf)

Create an OutputStream from a write function and optional close and flush functions. The write function maps to the .write method on the OutputStream class and takes 3 arguments: a byte array with the data to send, an offset and a length. The close function maps to the .close method and takes zero arguments. Similarly the flush function maps to the .flush method and also takes zero arguments.

Create an OutputStream from a write function and optional close and
flush functions. The write function maps to the `.write` method on the
OutputStream class and takes 3 arguments: a byte array with the data to send,
an offset and a length. The close function maps to the `.close` method and
takes zero arguments. Similarly the flush function maps to the `.flush`
method and also takes zero arguments.
sourceraw docstring

stream-handlerclj

(stream-handler handler)
(stream-handler handler
                {:keys [executor read-buffer-size] :or {read-buffer-size 8192}})

Create a Teensyp server handler from a function that takes an InputStream and OutputStream as arguments. Accepts an options map with the following keys:

:executor - an executor for running the handler function, defaults to a fixed thread pool of 32 threads :read-buffer-size - the size in bytes of the read buffer, defaults to 8K

Create a Teensyp server handler from a function that takes an InputStream
and OutputStream as arguments. Accepts an options map with the following keys:

:executor - an executor for running the handler function, defaults to a fixed
            thread pool of 32 threads
:read-buffer-size - the size in bytes of the read buffer, defaults to 8K
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close