Skip to content

Instantly share code, notes, and snippets.

View denen99's full-sized avatar

Adam Denenberg denen99

View GitHub Profile
@denen99
denen99 / eredis_help
Created March 20, 2012 13:21
AD pubsub
start_link() ->
io:format("Starting erltest1 pubsub server...~n"),
{ok, SubPid} = eredis_sub:start_link(),
io:format("Registering pid...~n"),
register(eredispid,SubPid),
io:format("Registered...~n"),
_Receiver = spawn_link(fun () ->
eredis_sub_client:controlling_process(SubPid),
receiver(SubPid)
end),
-module(pubsub_srv).
start_link() ->
{ok,PID} = eredis_sub:start_link(),
register(eredispid,PID),
{ok, PID}.
receiver(Sub) ->
receive
Msg ->
-module(pubsub_srv).
start_link() ->
{ok,PID} = eredis_sub:start_link(),
register(eredispid,PID),
_Receiver = spawn_link(fun () ->
eredis_sub:controlling_process(PID),
receiver(PID)
end),
{ok, PID}.
% snippet from pubsub_srv.erl
%-----------
start_link() ->
{ok,PID} = eredis_sub:start_link(),
register(eredispid,PID),
_Receiver = spawn_link(fun () ->
eredis_sub:controlling_process(PID),
receiver(PID)
end),
io:format("Eredis server started~n"),
This is against the sample route_match_example.rb vertx.io vertical in a single instance on my macbook air (Quad Core, 4GB Ram)
# httperf --server=localhost --port=8080 --uri=/ --num-conns=100 --num-calls=100
httperf --client=0/1 --server=localhost --port=8080 --uri=/ --send-buffer=4096 --recv-buffer=16384 --num-conns=100 --num-calls=100
httperf: warning: open file limit > FD_SETSIZE; limiting max. # of open files to FD_SETSIZE
Maximum connect burst length: 1
Total: connections 100 requests 10000 replies 10000 test-duration 1.420 s
Connection rate: 70.4 conn/s (14.2 ms/conn, <=1 concurrent connections)
-module(test).
-export([start/0,load_data/1,run_select/0,run_foldl/0]).
-define(TAB,testets).
start() ->
load_ets_table(),
load_data(5000000),
io:format("Load data complete~n"),
{T,_} = timer:tc(?MODULE,run_select, []),
As a production staff member I need to publish a revised Rundown to that it will reflect changes in the Show.
---
EC1: Publish does not appear on the interface or is greyed out by default.
EC2: User performs some type of edit to the Global Schedule
Note: Any segment in a published rundown can not be deleted
Note: A segment can not live in multiple rundowns
EC3: Publish button becomes active.
EC4: User clicks the "Publish" button
EC5: The Live Rundown and Global Schedule will reflect changes in the Dashboard and Segment Navigator is updates in all HPSN client applications
EC6: Websocket event should be sent to Channel:Rundown, Event:ScheduleUpdate ID0
As a Dashboard User I need to add pick specific types of assets for to the Resource Well so that the UI can reflect the proper layout.
---
Note: Existing data model works for the following asset types but Type needs to drive available fields
---
EC1: Change label on add button to "Add New Item" from "Add New Production Element"
EC2: Change dialog title to "New Resource Well Item" from "Add Production Element"
EC3: Make "Type" the first field to include the following items:
HuffPost_Article
5Min_Video
Video
@denen99
denen99 / gist:2852086
Created June 1, 2012 13:17
unicorn amqp
after_fork do |server, worker|
require "amqp"
amqp_opts = {:port => $RABBITMQ_PORT, :host => $RABBITMQ_HOST, :username => $RABBITMQ_USER, :password => $RABBITMQ_PASS, :vhost => $RABBITMQ_VHOST}
t = Thread.new { AMQP.start(amqp_opts) }
sleep(1.0)
EventMachine.add_periodic_timer(60) do
exchange = AMQP.channel.topic($TOPIC_EXCHANGE)
@denen99
denen99 / gist:3984463
Created October 31, 2012 02:30
Erlang cowboy master
22:29:19.609 [error] gen_server <0.1120.0> terminated with reason: bad argument in call to ets:select_delete(websocket, [{{{'_','_',{sockjs_session,{<0.1120.0>,[{peername,{{127,0,0,1},58181}},{sockname,{{127,0,0,...},...}},...]}}},...},...}]) in ets:match_delete/2 line 313
22:29:19.614 [error] CRASH REPORT Process <0.1120.0> with 1 neighbours exited with reason: bad argument in call to ets:select_delete(websocket, [{{{'_','_',{sockjs_session,{<0.1120.0>,[{peername,{{127,0,0,1},58181}},{sockname,{{127,0,0,...},...}},...]}}},...},...}]) in ets:match_delete/2 line 313 in gen_server:terminate/6 line 715
22:29:19.616 [error] Supervisor sockjs_session_sup had child undefined started with sockjs_session:start_link(undefined, {service,"/socket",#Fun<outbreak_sockjs_handler.0.133591038>,state,"http://cdn.sockjs.org/sockjs...",...}, [{peername,{{127,0,0,1},58181}},{sockname,{{127,0,0,1},8080}},{path,"/socket/websocket"},{headers,...}]) at <0.1120.0> exit with reason bad argument in call to ets:select_delete(websocket,