yaws

How to handle WebSocket messages in an appmod using Yaws?

戏子无情 提交于 2019-12-06 06:18:58
I have created a simple appmod that sends back the same message as it receives. But I get an error message at the command prompt and the WebSocket connection is closed. If I send a message with 3 chars I get this error message: =ERROR REPORT==== 8-Feb-2012::05:09:14 === Error in process <0.59.0> with exit value: {undef,[{mywebsocket,handle_message,[ {text,<<3 bytes>>}],[]},{lists,map,2,[{file,"lists.erl"},{line,1173}]},{yaws_web sockets,loop,4,[{file,"yaws_websockets.erl"},{line,151}]}]} What am I doing wrong? The handle uses text , and it doesn't work if I use binary either. Here is my HTML

REST API implementation using Yaws

不打扰是莪最后的温柔 提交于 2019-12-05 20:22:08
I'm trying to build a REST API using the Yaws web server but I'm unable to get Yaws to dispatch requests to my module. -module(rest). -include_lib("stdlib/include/qlc.hrl"). -include_lib("yaws/include/yaws_api.hrl"). -export([out/1, addAirport/4, handle/2]). -compile(export_all). -define(RECORD_TYPE, airport). -define(RECORD_KEY_FIELD, code). -record(airport, {code, city, country, name }). start() -> application:start(mnesia). do_this_once() -> mnesia:create_table(airport, [{attributes,record_info(fields,airport)},{index, [country]}]), mnesia:stop(). out(Arg) -> Method = method(Arg) , io

Erlang's maximum number of simultaneous open ports?

左心房为你撑大大i 提交于 2019-12-05 20:13:49
问题 Does the erlang TCP/IP library have some limitations? I've done some searching but can't find any definitive answers. I have set the ERL_MAX_PORTS environment variable to 12000 and configured Yaws to use unlimited connections. I've written a simple client application that connects to an appmod I've written for Yaws and am testing the number of simultaneous connections by launch X number of clients all at the same time. I find that when I get to about 100 clients, the Yaws server stops

how do we efficiently handle time related constraints on mnesia records?

℡╲_俬逩灬. 提交于 2019-12-05 06:49:12
问题 i am writing records into mnesia which should be kept there only for an allowed time (24 hours). after 24 hours, before a user modifies part of them, the system should remove them automatically. forexample, a user is given free airtime (for voice calls) which they should use in a given time. if they do not use it, after 24 hours, the system should remove these resource reservation from the users record. Now, this has brought in timers. an example of a record structure is: -record(free_airtime

Erlang's maximum number of simultaneous open ports?

陌路散爱 提交于 2019-12-04 03:03:36
Does the erlang TCP/IP library have some limitations? I've done some searching but can't find any definitive answers. I have set the ERL_MAX_PORTS environment variable to 12000 and configured Yaws to use unlimited connections. I've written a simple client application that connects to an appmod I've written for Yaws and am testing the number of simultaneous connections by launch X number of clients all at the same time. I find that when I get to about 100 clients, the Yaws server stops accepting more TCP connections and the client errors out with Error in process with exit value: {{badmatch,

how do we efficiently handle time related constraints on mnesia records?

点点圈 提交于 2019-12-03 20:51:24
i am writing records into mnesia which should be kept there only for an allowed time (24 hours). after 24 hours, before a user modifies part of them, the system should remove them automatically. forexample, a user is given free airtime (for voice calls) which they should use in a given time. if they do not use it, after 24 hours, the system should remove these resource reservation from the users record. Now, this has brought in timers. an example of a record structure is: -record(free_airtime, { reference_no, timer_object, %% value returned by timer:apply_after/4 amount }). The timer object in

Is it possible to develop a powerful web search engine using Erlang, Mnesia & Yaws?

岁酱吖の 提交于 2019-12-03 06:25:28
问题 I am thinking of developing a web search engine using Erlang, Mnesia & Yaws. Is it possible to make a powerful and the fastest web search engine using these software? What will it need to accomplish this and how what do I start with? 回答1: Erlang can make the most powerful web crawler today. Let me take you through my simple crawler. Step 1. I create a simple parallelism module, which i call mapreduce -module(mapreduce). -export([compute/2]). %%=================================================

Is it possible to develop a powerful web search engine using Erlang, Mnesia & Yaws?

99封情书 提交于 2019-12-02 19:47:19
I am thinking of developing a web search engine using Erlang, Mnesia & Yaws. Is it possible to make a powerful and the fastest web search engine using these software? What will it need to accomplish this and how what do I start with? Erlang can make the most powerful web crawler today. Let me take you through my simple crawler. Step 1. I create a simple parallelism module, which i call mapreduce -module(mapreduce). -export([compute/2]). %%===================================================================== %% usage example %% Module = string %% Function = tokens %% List_of_arg_lists = [["file

Very Large Mnesia Tables in Production

自闭症网瘾萝莉.ら 提交于 2019-11-29 21:48:52
We are using Mnesia as a primary Database for a very large system. Mnesia Fragmented Tables have behaved so well over the testing period. System has got about 15 tables, each replicated across 2 sites (nodes), and each table is highly fragmented. During the testing phase, (which focused on availability, efficiency and load tests), we accepted the Mnesia with its many advantages of complex structures will do for us, given that all our applications running on top of the service are Erlang/OTP apps. We are running Yaws 1.91 as the main WebServer. For efficiently configuring Fragmented Tables, we

Very Large Mnesia Tables in Production

别来无恙 提交于 2019-11-28 19:07:41
问题 We are using Mnesia as a primary Database for a very large system. Mnesia Fragmented Tables have behaved so well over the testing period. System has got about 15 tables, each replicated across 2 sites (nodes), and each table is highly fragmented. During the testing phase, (which focused on availability, efficiency and load tests), we accepted the Mnesia with its many advantages of complex structures will do for us, given that all our applications running on top of the service are Erlang/OTP