Git Product home page Git Product logo

erlang-and-otp-in-action-source's People

Contributors

ericbmerritt avatar leecoder avatar richcarl 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  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

erlang-and-otp-in-action-source's Issues

Chapter 6 simple cache error bad_return

I got this when i run the command "application:start(simple_cache)."
{error,
{bad_return,
{{sc_app,start,[normal,[]]},
{'EXIT',
{undef,
[{sc_app,start,[normal,[]],[]},
{application_master,start_it_old,4,
[{file,"application_master.erl"},{line,272}]}]}}}}}

=INFO REPORT==== 2-Apr-2015::11:37:28 ===
application: simple_cache
exited: {bad_return,
{{sc_app,start,[normal,[]]},
{'EXIT',
{undef,
[{sc_app,start,[normal,[]],[]},
{application_master,start_it_old,4,
[{file,"application_master.erl"},
{line,272}]}]}}}}
type: temporary

Second Edition

Hi,

do you plan to update the book to reflect trends in the community and language?

Thanks,
Chris

init(Port) args

when using
gen_server:start_link({local, ?SERVER}, ?MODULE, [Port], []).
...................
{ok, LSock} = gen_tcp:listen(lists:nth(1, Port), [{active, true}),
get a problem
** exception exit: function_clause
in function inet_tcp:getserv/1
called as inet_tcp:getserv([1055])

so I tried that
{ok, LSock} = gen_tcp:listen(lists:nth(1, Port), [{active, true}]),
now it goes well.

why does it have this problem?

Can't get http_interface working. Request keep crashing gws_server.

=SUPERVISOR REPORT==== 5-Oct-2011::11:40:20 ===
Supervisor: {<0.134.0>,gws_connection_sup}
Context: child_terminated
Reason: {function_clause,
[{gws_server,handle_info,
[{http,#Port<0.2726>,
{http_header,24,'User-Agent',undefined,
<<"curl/7.21.0 (i486-pc-linux-gnu) libcurl/7.21.0 OpenSSL/0.9.8o zlib/1.2.3.4 libidn/1.15 libssh2/1.2.6">>}},
{state,#Port<0.2725>,#Port<0.2726>,
{http_request,'GET',
{abs_path,<<"/foo">>},
{1,1}},
[],<<>>,0,hi_server,[],<0.134.0>}]},
{gen_server,handle_msg,5},
{proc_lib,init_p_do_apply,3}]}
Offender: [{pid,<0.135.0>},
{name,gws_server},
{mfargs,{gws_server,start_link,
[hi_server,#Port<0.2725>,[]]}},
{restart_type,temporary},
{shutdown,brutal_kill},
{child_type,worker}]

Chapter 3 - Calling get_count

Hi,

I'm following this book chapter by chapter, and so far I have enjoyed it a lot!. However, now I'm struggling with the get_count function. It seems that is not possible to call tr_server:get_count(). from telnet because this will cause a deadlock on the server side:

telnet localhost 1055
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
tr_server:get_count().
{timeout,{gen_server,call,[tr_server,get_count]}}
Connection closed by foreign host.

This makes sense to me, because handle_info is performing a call to tr_server:get_count() that performs a sync call to the server.

The thing that I don't understand is why when I'm calling get_count from the erlang console I get the same error:

13> tr_server:start_link(1055).
{ok,<0.76.0>}
14> tr_server:get_count().     
** exception exit: {timeout,{gen_server,call,[tr_server,get_count]}}
     in function  gen_server:call/2 (gen_server.erl, line 180)

The thing that makes more sad is the fact of why we define a get_count function if we cannot use it at all.

It would be great if you could help to understand this issue. I'm using the exact file from the repo, so I'm not introducing any noise.

Thanks,

Otp

let {code, type} = await navigator.credentials.get({otp: {transport: ["sms"]}});
// code == "123ABC78"
// type == "otp"

how to used the api

run after ok, how to used the api?
I tried and failed :
3> simple_cache:insert(lee, "leeyi").
...
4> simple_cache:insert(lee, leeyi).
...
5> simple_cache:insert(lee, 33).
...
6> simple_cache:insert(lee, [leeyi,dd]).
...
9> simple_cache:insert('lee', 'dd').
** exception error: bad argument
in function ets:lookup/2
called as ets:lookup(sc_store,lee)
in call from sc_store:lookup/1 (src/sc_store.erl, line 17)
in call from simple_cache:insert/2 (src/simple_cache.erl, line 8)

Errata page removed (now redirects to Manning book page)

The Manning book page doesn't have any visible links to an Errata page; however, that's where the two errata list links I found mentioned in the book forum redirect to.

(quote):
"The current errata list can always be found at http://www.manning.com/logan/excerpt_errata.html (or go to http://www.manning.com/logan/ and follow the link named "Errata", under Resources/Look inside)."

...from the current Book forum thread here:

https://forums.manning.com/forums/erlang-and-otp-in-action

thread:
"errata update 12/06/2010"
https://forums.manning.com/posts/list/24035.page

Manning book page
https://www.manning.com/books/erlang-and-otp-in-action

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.