Git Product home page Git Product logo

scalabilitywitherlangotp's Introduction

Code for Designing for Scalability with Erlang/OTP

In this repository you'll find the code of the examples in the book Designing for Scalability with Erlang/OTP.

The following excerpt from the book explains the terms for using the code in this repository:

This book is here to help you get your job done. In general, if example code is offered with this book, you may use it in your programs and documentation. You do not need to contact us for permission unless you're reproducing a significant portion of the code. For example, writing a program that uses several chunks of code from this book does not require permission. Selling or distributing a CD-ROM of examples from O'Reilly books does require permission. Answering a question by citing this book and quoting example code does not require permission. Incorporating a significant amount of example code from this book into your product's documentation does require permission.

We appreciate, but do not require, attribution. An attribution usually includes the title, author, publisher, and ISBN. For example: "Book Title by Some Author (O'Reilly). Copyright 2016 Some Copyright Holder, 978-0-596-xxxx-x."

If you feel your use of code examples falls outside fair use or the permission given above, feel free to contact us at [email protected].

scalabilitywitherlangotp's People

Contributors

francescoc avatar vinoski avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

scalabilitywitherlangotp's Issues

"target_system.erl" module is not included?

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(F)` creates duplicates and inserts non-allocatable frequencies

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],[]}

phone:start_test - phone_fsm processes don't run under supervision

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).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.