Skip to content

Instantly share code, notes, and snippets.

🐬
QUIC for Netty

Oleksii Kachaiev kachayev

🐬
QUIC for Netty
Block or report user

Report or block kachayev

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View aleph-part-1.md

Aleph, Part I

A lot has happened these last few weeks. The key focus was on implementing new features, so let's enumerate all of them.

WebSockets

  • #422 "Handle WebSocket handshake timeouts".

Initially implemented by Denis Shilov. Thanks a lot! I've reimplemented the functionality partially to avoid usage of Manifold's timer. Mostly becase of performance considerations. I've also opened the same issue for Netty as this functionality is not covered by built-in websocket protocol handlers. And it was already implemented here by Qin Shicheng.

View manifold-cancel.clj
(require '[manifold.deferred :as d])
(defn long-boring-computation []
(let [result (d/deferred)]
(d/future
(dotimes [_ 100]
(when-not (d/realized? result)
;; block the thread is still a bad idea :(
(Thread/sleep 1e3)))
(d/success! result "I'm done with this"))
@kachayev
kachayev / aleph-planning.md
Last active Feb 13, 2019
A few thoughts on Aleph development
View aleph-planning.md

Aleph, Async, HTTP, Clojure

I've been working with Aleph rougly for last 5 years, actively contributing to the library for last 2 (or so). I also put some effort into spreading the word about it, including educational tech talks, like "Deep HTTP Dive Throught Aleph & Netty". But the more I talk to people the more confusion I find, mostly about how Aleph works and what can you expect when adding it to your stack. Clojurists Together has recently announced Aleph to get Q1 funding, I think it's a good time to share my priorities and thoughts on development plans that were mentioned in the blog post. Hope the community would find it interesting and helpful.

Aleph describes itself as "asynchronous communication for Clojure" library. And you should probably pay a good portion of your attention to the first word: "asynchronous".

@kachayev
kachayev / logic.py
Last active Jul 11, 2017
Lazy developer's approach to do exercises on Propositional Logic
View logic.py
# -*- coding: utf-8 -*-
from tabulate import tabulate
class Var(object):
def __init__(self, name):
self.name = name
self.value = None
def bind(self, value):
View async-timeline.clj
(defn fetch-user
[id]
(fetch-item id))
(defn fetch-post
[id]
(fetch-item id))
(defn timeline-ids
[username]
@kachayev
kachayev / concurrency-in-go.md
Last active Aug 22, 2019
Channels Are Not Enough or Why Pipelining Is Not That Easy
View concurrency-in-go.md
@kachayev
kachayev / css-parser.md
Last active Jul 9, 2019
Parsing CSS file with monadic parser in Clojure
View css-parser.md
View kleene.clj
(ns kleene)
;;
;; Inspired by "Regexes, Kleene Algebras and Real Ultimate Power"
;; http://plastic-idolatry.com/erik/oslo2014.pdf
;;
;; What do we want to do?...
;;
;; (def p1 (times (Var. "w") (Var. "o") (Var. "w"))
;; (matches? p1 "wow") ;; true
View 001_monad_parser.py
## Alexey Kachayev, 2014
## Link to slides:
## http://goo.gl/n4ylC4
## Basic:
## type Parser = String -> Tree
## Composition
## type Parser = String -> (Tree, String)
View skew.py
def heap(el=None):
return (el, None, None)
def union((el1, left1, right1), (el2, left2, right2)):
if el1 is None: return (el2, left2, right2)
if el2 is None: return (el1, left1, right1)
if el1 < el2:
return (el1, union((el2, left2, right2), right1), left1)
else:
return (el2, union((el1, left1, right1), right2), left2)
You can’t perform that action at this time.