aleph

2016-05-02T17:06:37.000009Z

interesting behavior of manifold.stream/consume - it ignores buffers, so if your consumer function is slower than the producer the producer will block as if the stream was unbuffered, e.g.

(def stream (s/stream 5))

(future 
  (s/consume 
    (fn [x] 
      (println x) 
      (Thread/sleep 1000)) 
    stream))

(future
  (doseq [n (range 10)] 
    @(s/put! stream n)
    (println "put" n)))

2016-05-02T17:11:30.000011Z

gives

1
put 1
2
put 2
etc

2016-05-02T17:12:49.000012Z

if you swap the consume call with a loop that takes from the stream, the first 5 put!s succeed immediately, filling the buffer, as you would expect.

2016-05-02T21:39:20.000014Z

has anyone managed to get aleph websocket server to aggregate fragmented frames?

2016-05-02T22:25:37.000015Z

so my fix is one line but would probably be something you want to pass in as a config param

2016-05-02T22:26:21.000016Z

in the initialize-websocket-handler when you setup the pipeline right before adding the "websocket-handler" we need to add the "websocket-frame-aggregator"

2016-05-02T22:26:26.000017Z

(.addLast pipeline "websocket-frame-aggregator" (WebSocketFrameAggregator. (* 16 1024 1024)))

2016-05-02T22:26:48.000018Z

(that large number is what would be passed in as a config param I assume)

2016-05-02T22:27:01.000019Z

anyway this totally worked and I can now paste giant images over aleph sockets

2016-05-02T22:27:31.000020Z

@ztellman: forgot to tag you in the above