erlang

Erlang/OTP architecture: RESTful protocol for SOAish services

痴心易碎 提交于 2019-12-21 01:22:33
问题 Let us imagine we have an orders processing system for a pizza shop to design and build. The requirements are: R1. The system should be client- and use-case-agnostic, which means that the system can be accessed by a client which was not taken into account during the initial design. For example, if the pizza shop decides that many of its customers use the Samsung Bada smartphones later, writing a client for Bada OS will not require rewriting the system's API and the system itself; or for

Erlang/OTP architecture: RESTful protocol for SOAish services

左心房为你撑大大i 提交于 2019-12-21 01:22:16
问题 Let us imagine we have an orders processing system for a pizza shop to design and build. The requirements are: R1. The system should be client- and use-case-agnostic, which means that the system can be accessed by a client which was not taken into account during the initial design. For example, if the pizza shop decides that many of its customers use the Samsung Bada smartphones later, writing a client for Bada OS will not require rewriting the system's API and the system itself; or for

Sorting Erlang records in a list?

自闭症网瘾萝莉.ら 提交于 2019-12-20 19:47:25
问题 I have a record in erlang: -record(myrec, { id = 0, price = 0, quantity = 0 }). I then have a list of records that I want to sort by id and price, both in descending and ascending order, where price is the first key and if two records have the same price I want to sort those by id. How can I define a fun for this? I'm a newb at Erlang :) thanks, nisbus 回答1: This is a shorter solution than what has been suggested so far. First define your record: 1> rd(myrec, {id=0, price=0, quantity=0}).

搭建 RabbitMQ Server 高可用集群

旧城冷巷雨未停 提交于 2019-12-20 18:15:03
原文: 搭建 RabbitMQ Server 高可用集群 阅读目录: 准备工作 搭建 RabbitMQ Server 单机版 RabbitMQ Server 高可用集群相关概念 搭建 RabbitMQ Server 高可用集群 搭建 HAProxy 负载均衡 因为公司测试服务器暂不能用,只能在自己电脑上重新搭建一下 RabbitMQ Server 高可用集群,正好把这个过程记录下来,以便日后查看。 公司测试服务器上的 RabbitMQ 集群,我搭建的是三台服务器,因为自己电脑空间有限,这边只能搭建两台服务器用作高可用集群,用的是 Vagrant 虚拟机管理工具。 环境介绍: RabbitMQ 节点 IP 地址 工作模式 node1 192.168.1.50 DISK CentOS 7.0 - 64位 node2 192.168.1.51 DISK CentOS 7.0 - 64位 整体架构: 1. 准备工作 首先,在 node1 服务器上,修改 vi /etc/hostname : node1 在 node2 服务器上,修改 vi /etc/hostname : node2 然后在 node1 服务器上,修改 vi /etc/hosts : node1 192.168.1.50 node2 192.168.1.51 127.0.0.1 node1 ::1 node1 在 node2

Elixir call Axis2 Java SOAP Web Service with detergentex and detergent

☆樱花仙子☆ 提交于 2019-12-20 18:07:01
问题 From Elixir, I am trying to call a SOAP Web Service with detergentex, which is a wrapper around the Erlang library detergent. I can call the SOAP Web Service in the example on the detergent home page with no problems: http://www.webservicex.net/convertVolume.asmx?WSDL Parameters: wsdl_url = "http://www.webservicex.net/convertVolume.asmx?WSDL" action = "ChangeVolumeUnit" parameters = ["100","dry","centiliter"] However when trying to call an Axis2 Java SOAP Web Service I am having some problems

Why Erlang variable is unused?

十年热恋 提交于 2019-12-20 17:28:46
问题 Why does compiling this code: triples( [], _,_,_)-> []; triples( Self, X, Y, none )-> [ Result || Result = { X, Y, _} <- Self ]. report: ./simple_graph.erl:63: Warning: variable 'X' is unused ./simple_graph.erl:63: Warning: variable 'Y' is unused ./simple_graph.erl:64: Warning: variable 'X' is unused ./simple_graph.erl:64: Warning: variable 'X' shadowed in generate ./simple_graph.erl:64: Warning: variable 'Y' is unused ./simple_graph.erl:64: Warning: variable 'Y' shadowed in generate And

Which programming languages support hot code swapping and/or sandboxing?

*爱你&永不变心* 提交于 2019-12-20 12:46:10
问题 I would like to write a web based MMO game that will allow users to write AI and run it as part of the game. I plan to use Html5 for graphics and want this to be web based so it can be accessed from smartphones. I need to find a programming language that will support sandboxing, concurrency, hot code swapping, and a large library to make things easier. At this time my research is turning up Erlang, Stackless Python, and Lua. Any help is appreciated. 回答1: Erlang does not support sandboxing, so

what is the proper way to backup/restore a mnesia database?

旧城冷巷雨未停 提交于 2019-12-20 12:34:14
问题 WARNING: the background info is pretty long. Skip to the bottom if you think you need the question before the background info. Appreciate the time this is gonna take! I've been all over the web (read google) and I have not found a good answer. YES, there are plenty of links and references to the Mnesia documentation on the erlang.org site but even those links suffer from version-itis. So in the simplest case where the node() you are currently connected to is the same as the owner of the table

With Boost.Fiber does c++ come one step closer to Erlang style process/threads?

混江龙づ霸主 提交于 2019-12-20 12:09:35
问题 I am reading http://olk.github.io/libs/fiber/doc/html/ It seems to me that with Boost.Fiber C++ is coming closer to Erlang's ability to have thousands of "processes", also known as "green processes[threads]" http://en.wikipedia.org/wiki/Green_threads. My question is, is Boost.Fiber ready for production, are there now c++ alternatives that have better documentation and examples? Someone mentioned lightweight threads, but I can't seem to find a reference to it. One final question is, why doesn

how do I remove an extra node

☆樱花仙子☆ 提交于 2019-12-20 10:40:20
问题 I have a group of erlang nodes that are replicating their data through Mnesia's "extra_db_nodes"... I need to upgrade hardware and software so I have to detach some nodes as I make my way from node to node. How does one remove a node and still preserve the data that was inserted? [update] removing nodes is as important as adding them. Over time as your cluster grows it must also contract. If not then Mnesia is going to be busy trying to send data to nonexistent nodes filling up queues and