Erlang – nested word programming

Erlang – nested word programming Use TCP Get data from server A simple TCP server Improve server control logic 1. Active message reception (non-blocking) 2. Passive message reception (blocking type) 3. Mixed message reception (partial blocking) connect UDP Simple UDP server and client UDP server that calculates factorial Things to note about UDP Socket programming […]

Erlang – database

Erlang–Database Create database code listing Starting and loading tables (preparation) Query all data Query specified column data Conditional query Multi-table related query adding data delete data Mnesia Affairs Cancel a transaction Table type and location Generally, it is necessary to use a database for development work. Mnesia is a fast database written in Erlang. Create […]

erlang distributed programming

Foreword Writing distributed programs in Erlang is only one step away from writing concurrent programs. In distributed Erlang, processes can be split on remote nodes and machines. After splitting out the remote process, we will see that all other basic functions (send, receive, link, etc.) can operate transparently in the network, just like on a […]

Erlang – file programming

Erlang–File Programming File programming read file 1. Read all data 2. Read one data item at a time 3. Read one line at a time 4. Read the contents of the entire file into a binary data 4. Randomly read a file write file 1. Write a string of Erlang data items 2. Write a […]

Introduction to concurrent programming in erlang

Erlang concurrent programming! Review concurrency How to concurrency Basic functions spawn send receive Concurrent programming examples timeout acceptance Registration process register(NameAtom,Pid) unregister(NameAtom) whereis(NameAtom) registered() Errors in concurrency link(connection) monitor(monitor) Reviewing concurrency First, two concepts need to be explained, concurrency and parallelism: Concurrency: Multiple operations can be processed alternately within the same time period, emphasizing that […]

Erlang Garbage Collection

This is an update to the previous blog post Erlang 19.0 Garbage Collection. With the release of Erlang/OTP 20.0, a few things changed, which is why we updated this blog post. Erlang uses a tracking garbage collector to manage dynamic memory. More precisely, a per-process generational half-region copy collector using Cheney’s copy collection algorithm and […]

Use Erlang’s wx to draw a hexagonal lattice

The layout is that the vertices of the hexagons face up, and the odd rows move to the right. Counting starts from the lower left corner of the screen, consistent with the coordinate system of the front-end unity xoz. %%%——————————————– ———————– %%% @author pan %%% @copyright (C) 2023, <COMPANY> %%% @doc %%% %%% @end %%% […]

ErlangOTP build application – process pool

ErlangOTP build application – process pool foreword process pool process pool supervision tree implement supervisor process pool server implementation worker test Foreword Will use the general server (gen_sever), FSM (gen_fsm), event processor (gen_event) and supervisor (supervisor) to build applications for actual combat Process pool The idea behind process pools is to manage and limit the […]

Installation of rabbitmq and erlang under linux

There were various problems with the rabbitmq and erlang installed before, so I uninstalled and reinstalled them all 1. Uninstall erlang, rabbitmq 1. Uninstall the rabbitmq service Stop the entire rabbitmq service before uninstalling rabbitmqctl stop View the related list of rabbitmq installations yum list | grep rabbitmq Uninstall the related content that rabbitmq has […]

install rabbitMq3.11.10 and erlang25 on centos7.6

1. Download erlang first, and you can see the version according to the figure below Address: https://github.com/erlang/otp/releases/ turn up 2. Download rabbitmq3.11.10 Address: https://rabbitmq.com/install-rpm.html#downloads 3. Upload the two files downloaded above to the /usr/local/software directory (according to your preference) 4. Install erlang Terminal cd /usr/local/software to enter the directory cd /usr/local/software 4.1 Unzip erlang tar […]