This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected $_UtcNames = array( | |
'UTC-12' => 'Yankee', | |
'UTC-11' => 'X-Ray', | |
'UTC-10' => 'Whiskey', | |
'UTC-9' => 'Victor', | |
'UTC-8' => 'Uniform', | |
'UTC-7' => 'Tango', | |
'UTC-6' => 'Sierra', | |
'UTC-5' => 'Romeo', | |
'UTC-4' => 'Quebec', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(test_loop). | |
-export([start_link/0, init/0]). | |
-record( | |
state, | |
{ | |
status = free :: free | busy | |
} | |
). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
get_handler(Binary, AccountId, Uid) -> | |
try decode(Binary) of | |
{ok, Type, Priority, {M, F, A}} -> | |
{ok, Type, Priority, {M, F, A ++ [AccountId, Uid]}} | |
catch | |
error:Error -> | |
?ERROR("tpf_eva decoder reports bad binary input: ~p", [Error]), | |
{error, Error}; | |
exit:{error, Why} -> | |
?ERROR("tpf_eva decoder reports ~p", [Why]), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Specs = [ | |
{name, fun | |
(Data) when is_list(Data) -> ok; | |
(Data) -> {error, not_list} | |
end}, | |
{age, fun | |
(Data) when is_integer(Data) -> ok; | |
(Data) -> {error, not_integer} | |
end} | |
], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(gen_tpf_eva_handler). | |
-export([get_module_name/3]). | |
-callback major_version() -> | |
integer(). | |
-callback minor_version() -> | |
integer(). | |
-callback handle(binary()) -> | |
ok | {error, any()}. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
send_error(ReplyTo, UUID, RoutingKey, {invalid, protobuff}) -> | |
eva_tpf:generic_error(ReplyTo, UUID, RoutingKey, [ | |
{source, 'CLIENT'}, | |
{type, <<"INVALID_PROTOBUFF_BINARY">>}, | |
{description, <<"Protobuff binary provided is invalid">>}, | |
{permanent, true} | |
]); | |
send_error(ReplyTo, UUID, RoutingKey, {invalid, props}) -> | |
eva_tpf:generic_error(ReplyTo, UUID, RoutingKey, [ | |
{source, 'CLIENT'}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{redis_pool2,{poolboy,start_link,[[{name,{local,redis_pool2}},{worker_module,ept_redis_worker},{size,10},{max_overflow,100}],["localhost",6402]]},permanent,5000,worker,[poolboy]}, | |
{redis_pool1,{poolboy,start_link,[[{name,{local,redis_pool1}},{worker_module,ept_redis_worker},{size,10},{max_overflow,100}],["localhost",6401]]},permanent,5000,worker,[poolboy]}, | |
{redis_pool0,{poolboy,start_link,[[{name,{local,redis_pool0}},{worker_module,ept_redis_worker},{size,10},{max_overflow,100}],["localhost",6400]]},permanent,5000,worker,[poolboy]} | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
init([Host, Port]) -> | |
try eredis:start_link(Host, Port) of | |
{ok, C} -> | |
{ok, #state{redis_conn = C}}; | |
{error, Error} -> | |
?WARNING("Redis connection (~p:~p) failed: ~p", [Host, Port, Error]), | |
{ok, #state{}}; | |
Else -> | |
?WARNING("Redis connection (~p:~p) failed: ~p", [Host, Port, Else]), | |
{ok, #state{}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(handler_param_action). | |
-behaviour(gen_handler). | |
-include("ept.hrl"). | |
-include("ept_hit.hrl"). | |
-include_lib("cowboy/include/http.hrl"). | |
-export([prepare/2, handle/1]). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl "localhost:12330/counter?action=offer_complete&sid=123123123&hash=epttest&hashVar=epttest" | |
<<"{\"method\":\"completeOffer\",\"sid\":\"123123123\",\"hash\":\"epttest\",\"hashVar\":\"epttest\"}">> |
OlderNewer