hubertlepicki

hubertlepicki

2
Post #203
Crowdhailer

Crowdhailer

Creator of Raxx

Developing an HTTP/2 server required an interface that supporting bidirectional streaming. This post explains how a Rack style interface was modified for the task and how to start using it to serve content over HTTP/2 today.

1
Post #204
bzhr

bzhr

I’ve been through some of your posts, great stuff!

1
Post #205
bzhr

bzhr

there are a lot of practical tips in your posts, but I don’t like the click-baity titles :neutral_face:

0
Post #206
blackode

blackode

sorry about that… will try some better ones next time…
I really did not think what made you baity about…
Thanks for the valuable feed back.

0
Post #207
rvirding

rvirding

Creator of Erlang

One thing in your example: a chain of or does NOT behave in the same way as a chain of when in the presence of errors in the guard. The difference is that the or chain is one guard so if there is an error then the whole guard fails while the when chain is a sequence of guards so if there is an error in one then the next one will be tried. For example the functions l/2 and g/2 below when called with D.l(:a,:a) and D.g(:a,:a):

Interactive Elixir (1.4.4) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> defmodule D do
...(1)>   def l(a, b) when (a + b) > 1 or a == b do :yes end
...(1)>   def g(a, b) when (a + b) > 1 when a == b do :yes end
...(1)> end
{:module, D,
 <<70, 79, 82, 49, 0, 0, 5, 136, 66, 69, 65, 77, 69, 120, 68, 99, 0, 0, 0, 211, 
   131, 104, 2, 100, 0, 14, 101, 108, 105, 120, 105, 114, 95, 100, 111, 99, 115, 
   95, 118, 49, 108, 0, 0, 0, 4, 104, 2, ...>>, {:g, 2}}
iex(2)> D.l(1,2)
:yes
iex(3)> D.l(:a,:b)
** (FunctionClauseError) no function clause matching in D.l/2
    iex:2: D.l(:a, :b)
iex(3)> D.l(:a,:a)
** (FunctionClauseError) no function clause matching in D.l/2
    iex:2: D.l(:a, :a)
iex(3)> D.g(1,2)
:yes
iex(4)> D.g(:a,:a)
:yes
iex(5)>

Subtle but useful.

6
Post #208
AstonJ

AstonJ

You can do either :slight_smile:

Some people simply post their blog posts in this thread, some like to start a dedicated thread for their blog (or series) in this section - either one is fine :023:

1
Post #212
bzhr

bzhr

I expect to find out something informative from the title of the post like what I am going to learn or what kind of problem will be solved. Even if it’s a list of small tips some kind of hint would make a difference for me.

0
Post #213
blackode

blackode

Thanks. That really makes sense. I will take your point seriously and will come up with good concepts.
Once again thanks for the valuable feedback :bouquet: :bouquet:

1
Post #214