Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8931249
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T09:04:31+00:00 2026-06-15T09:04:31+00:00

My working environment is Erlang. Can a process having 2 different functions have two

  • 0

My working environment is Erlang.
Can a process having 2 different functions have two receive blocks in the different functions.

receive
....
end.

request()
PID!(message)
%% Can i get the reply back here instead of the receive block above?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T09:04:31+00:00Added an answer on June 15, 2026 at 9:04 am

    Yes, you can have many receive expressions. When one is evaluated it will take the first matching message out of the message queue/mailbox (take your pick of names) and leave the rest for the next receive. Sending a message, using the Pid ! Message syntax (the only way), is completely asynchronous and just adds the message to the end of the receiving processes message queue. receive is the only way to receive messages i.e. take them out of the message queue. You can never put them back.

    There is no built-in synchronous message passing in Erlang, it is one by sending two messages:

    • The “requesting” process sends a message to the receiving process and then goes into a receive to wait for the reply.

    • The “receiving” process will itself get the message in a receive, process it, send the reply message back the the “requesting” process and then go into a receive to sit and wait for the next message.

    Remember there is no inherent connection between processes, ever, and all communication is done using asynchronous message sending and receive.

    So in reply to your second question: you can ONLY get a reply back in a receive expression. That is the only way!

    Sorry to be a bit pedantic but Erlang doesn’t have either blocks or statements. It is a functional language and only has expressions which always return a value even if the return value is sometimes ignored.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a working WAMP environment (Apache Friends). I decided to try Subversion and
I have a website that per original developer was working on local environment. I
I have Developed an Stand alone application (.jar) which is working on Linux environment,
Actually I have a file . I am working in linux environment. I need
I am working in linux bash environment, and I have many files to edit,
my Lisp-working-environment has the frame split into two windows, the former for the main
I have a local environment working fine. Pasted a test route in .htaccess and
I just started working in an environment that uses multiple programming languages, doesn't have
Working environment is SQL Server 2000. I have a table with no indexes, no
i have a working environment for my rails app hosted on vm. I'm using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.