I have the following function: def join(id) do if Node.connect(:"#{id}@127.0.0.1") do send :global.whereis_name(id), {:join, id} end end I receive the error: (ArgumentError) argument error :erlang.send(:undefined, ... which I assume is because Node.connect does some gathering of information and when I call :global.whereis_name it has not finished yet. If I throw in a :timer.sleep(1000) sure enough
I'm currently picking up Erlang, and its pattern matching is one of the coolest things I've seen in awhile. One little toy function I've come up with in my exercises is as follows: b_and(true, true) -> true; b_and(true, false) -> false; b_and(false, true) -> false; b_and(false, false) -> false; b_and(_, _) -> {error, invalid_object}. I was wondering, though, is there syntax for telling a Variable
I want to write a some kind of supervisor and I'm trying to implement function that closes an external program. The external process is connected to an erlang's code with a port. I have no idea how to close this program, by sending a signal or anything else. Closing a port is not a solution, becouse I've checked that many programs doesn't exit on SIGPIPE. Have you got any ideas how to do it?
I am trying to create a distributed client network using Tsung. I have a cluster of 14 different machines. I want to use m01 as the server and machines m02 and m03 as the clients (or simulated users). Here is what I wrote: <!-- Client side setup --> <clients> <client host="localhost" maxusers="400" cpu="1"><ip value="192.168.1.2"/></client> <client host="m03" maxusers="400" cpu="1"><ip value="192.
To classify things, lets define the memory layout and then talk about how GC works. Memory Layout In Erlang, each thread of execution is called a process. Each process has its own memory and that memory layout consists of three parts: Process Control Block, Stack and Heap. PCB: Process Control Block holds information like process identifier (PID), current status (running, waiting), its registered
I'm new to Erlang so I am working on an example program and struggling to decide whether I should use an array or a list. Both are easy to create and handle but I didn't get: How you append an item to an array without knowing an index of where it should be appended. Is array:set(array:size(A),"a",A) the way to go? How to find out if a certain element is a member of the array, just as the lists:mem
We use RABBITMQ to bind up all our applications into a complete set of things. Within the whole setup is a central RABBITMQ server to which systems create queues , whether persistent or temporary. Because of RABBITMQ availability, our entire distribution system runs on top of it. Systems built using different technologies send and receive tasks from other systems via RABBITMQ. We came up with a Me
TL;DR: ETS table allocated memory size in bytes: ets:info(Table,memory) * erlang:system_info(wordsize). To elaborate a bit, ets:info(Table,memory) gives you the words allocated to data in an ETS table (same for Mnesia. You can view al that info in the TV application. The same attribute for DETS tables is in bytes). A word is nothing more than the 'natural' data unit of a particular CPU architectur
I understand from here http://cs.ucsb.edu/~puneet/reports/erlang.pdf (section 4.4) that Process Scheduling in Erlang is based on 4 different queues - with one designated as 'highest priority'. I have an Erlang program and I'd like to assign one process so that its instructions join this queue. Is there a way to do this? Are there any watch-its when doing this?
I have a function in which I have a series of individual case statements. case ... of ... end, case ... of ... end, ... etc. I want to return from the function immediately when a particular case condition occurs in one of the case statements - so that the next case statement is not checked, and the function just exits/returns. How do I do that?
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く