It's relatively easy to scale out stateless web applications. You often only need a reverse proxy. But for those stateful web applications, especially those applications that embeds websocket services in them, it's always a pain to distribute them in a cluster. The traditional way is introducing some external services like Redis to handle pubsub, however, in such way, you often need to change your code. Can Erlang/Elixir, the "concurrency oriented programming languages", best other languages in this use case? Has Phoenix framework already integrated the solution of horizontally scaling websocket? I'll do an experiment to prove (or disprove) that.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The `decode` function has been re-adapted from code provided by Moodstocks SAS and | |
therefore the following license applies to it: | |
Copyright (C) 2014 by Moodstocks SAS | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is |
List moved
Please use https://github.com/bf4/learning to fork and pull changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[david: compare]$ # at this point we have a stock rails app with no minitest tests and one pending rspec example | |
[david: compare]$ | |
[david: compare]$ time rake test | |
Run options: | |
# Running tests: | |
Finished tests in 0.030419s, 0.0000 tests/s, 0.0000 assertions/s. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'benchmark/ips' | |
require 'allocation_stats' | |
def access_slashed_string | |
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis molestie " \ | |
"elementum urna, a accumsan nunc euismod et. Aliquam porttitor, leo in " \ | |
"aliquet aliquam, magna quam venenatis nulla, vel sagittis nisi nisi et " \ | |
"nulla. Nulla quis facilisis turpis, vel blandit risus. Maecenas ut ante " \ | |
"quis velit pretium pharetra ac rhoncus massa. Nulla quam dui, placerat " \ | |
"eget quam vel, ultricies eleifend sem." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~ #node.js | |
[20.16.16] < TheEmpath> so | |
[20.16.34] < TheEmpath> anyone else have a hot programmer girl in their office? o____O | |
[20.16.42] < Lorentz> I wiiish | |
[20.16.48] <@Nexxy> not appropriate. | |
[20.16.57] »¡« Signoff caaakeeey: #Node.js (Ping timeout: 260 seconds) | |
[20.17.32] < joshwnj> yeah guys, grow up | |
[20.17.38] < jerrysv> Nexxy: olynode was fun, you should have gone | |
[20.18.03] < TheEmpath> my boss came by and said "Here, a new subodinate" and its a very attractive female. the otherwise painfully quite engineering room suddenly came to life and its a problem :X | |
~~~~~~~ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@states = { | |
AL: "Alabama", | |
AK: "Alaska", | |
AZ: "Arizona", | |
AR: "Arkansas", | |
CA: "California", | |
CO: "Colorado", | |
CT: "Connecticut", | |
DE: "Delaware", | |
FL: "Florida", |
NewerOlder