`

ranch源码阅读

 
阅读更多

cowboy源码分析:http://www.cnblogs.com/poti/archive/2013/01/21/2870302.html

 
遗留问题:
 
1、supervisor:
  start_link,init -> {RestartStrategy, MaxR, MaxT, [ChildSpec]}
  start,terminate,delete,restart
  which,count,check
  childspec(): {Id, StartFunc, Restart, Shutdown, Type, Modules}
  
 2、-export_type([max_conns/0])
  -spec A::maxconns()
 
3、eprof
  eprof:start()
  eprof:profile([self()], M, F, A) -> {ok, Value}
  eprof:stop_profiling()
  eprof:log(File::string())
  eprof:analyze()
 
4、erlang:monitor(process, Pid) -> RefMon.
  demonitor(RefMon, [flush]) -> true.
  清空MQ中可能存在的DOWN消息。
  {'DONW', MonRef, process, Pid, Reason}
 
5、file:send(File, Socket)
  (Fd, Socket, Offset, Bytes, Opts)
  ssl貌似无此能力
 
6、ets:lookup(Tab, Key) -> [Obj]
  lookup_element(Tab, Key, Pos) ->Elem
  update_counter(Tab, Key, Incr) 
  update_counter(Tab, {Pos, Incr})
  update_element(Tab, Key, [{Pos, Value}])
  insert(Tab, Objs) -> true
  insert_new(Tab, Objs) -> true | false 确保不重复才插入
 
7、lists:keystore  直接插入,如果存在,则覆盖
  keyreplace  只在存在时才覆盖,否则不插入
  keydelete
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics