加载中
使用callback实现自定义的erlang行为模式

之前erlang中自定义行为模式,需要导出behaviour_info函数,比如: -module(gen_foo). -export([behaviour_info/1]). behaviour_info(callbacks) -> [{foo, 0}, {bar, 1}, {baz, 2}]; b...

gen_server的enter_loop分析

在看ranch user guide的过程中,发现实现protocol handler需要使用特殊的gen_server形式,也就是enter_loop函数调用,事例代码如下: -module(echo_protocol). -behaviour(ranch_protocol). ...

erlang的类型规范type和opaque的区别

erlang中声明新类型,使用type和opaque关键字 type的使用 -module(module1). -export_type([my_tup2/0]). -type my_tup2() :: {my_tup2, atom(), atom()}. -module(module2). -export([ma...

2013/03/30 16:18
3.7K
蛋疼的erlang dialyzer

dialyzer:erlang的静态代码分析工具 -module(module1). -export([main/0]). -export_type([my_tup2/0]). -opaque my_tup2() :: {atom(), atom()}. -spec foo5(my_tup2())-> ok. foo5({_,...

解析Erlang日志组件lager的监督树和模块

lager_app 应用行为模式实现 Handlers = [{ lager_console_backend, info}, { lager_file_backend, [ {"log/error.log", error, 10485760, "", 5}, {"log/console.log", info, 10485760, "",...

ETS Concurrency

Concurrency This module provides some limited support for concurrent access. All updates to single objects are guaranteed to be both atomic and isolated. This means that an upda...

解析Erlang日志组件lager的lager_transform模块

使用 lager 的时候,在编译应用的时候,需要加入选项 {parse_transform, lager_transform} erlc 会在编译你的项目源代码的时候,把生成的 abstract format forms 交给 lager_transform 模块的...

没有更多内容

加载失败,请刷新页面

没有更多内容

返回顶部
顶部