francescoc / scalabilitywitherlangotp Goto Github PK
View Code? Open in Web Editor NEWThe repository for the code of the examples in the book Designing for Scalability with Erlang/OTP
The repository for the code of the examples in the book Designing for Scalability with Erlang/OTP
there is no terminate
implement.
As I said the bsc-1.0/ebin
is empty and don't easy for new beginner to run through .
Starting at page 193 (Chapter 8: Gluing it all together) phone:start_test/2
needs to work differently than the way it is currently represented in this repository. phone:start_test(150, 500)
uses
start_test(Num, Calls) ->
[phone_fsm:start_link(X) || X <- lists:seq(1,Num)],
call(Calls, Num).
which means that the phone_fsm
processes are not running under the supervision of the simple_phone_sup
(or phone_sup
) supervisor. One possible workaround could be to define phone:start_test/3
such that:
start_test(Attach, Num, Calls) ->
[Attach(X) || X <- lists:seq(1,Num)],
call(Calls, Num).
Then it could be used as:
phone:start_test(fun phone_fsm:start_link/1 ,150, 500).
phone:start_test(fun simple_phone_sup:attach_phone/1 ,150, 500).
phone:start_test(fun phone_sup:attach_phone/1 ,150, 500).
In section "Wrapping Up" of chapter 11:
In doing so, the user’s guide introduces the target_system.erl module shipped in the sasl application’s examples directory as well as in this chapter’s directory in the book’s GitHub repository.
Does it mean this repository included "target_system.erl" module in ch11 directory? But I didn't find it.
Thanks.
frequency:deallocate
does not care what the allocatable frequencies are and happily inserts non-allocatable frequencies in the "allocatable" list, even duplicating them.
Erlang/OTP 18 [erts-7.3] [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false]
Eshell V7.3 (abort with ^G)
1> c(frequency).
frequency.erl:4: Warning: undefined callback function code_change/3 (behaviour 'gen_server')
{ok,frequency}
2> frequency:start().
{ok,<0.41.0>}
3> l(sys).
{module,sys}
4> sys:statistics(frequency, true).
ok
5> sys:get_state(frequency).
{[10,11,12,13,14,15],[]}
6> frequency:deallocate(999).
ok
7> sys:get_state(frequency).
{[999,10,11,12,13,14,15],[]}
8> frequency:deallocate(10).
ok
9> sys:get_state(frequency).
{[10,999,10,11,12,13,14,15],[]}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.