NaN
How are PIDs generated? What does each segment ie <a.b.c> denote?
The problem. Im using Task.async_stream/5 to parse very large files. There are occasions where if a new value meets the search criteria but comes earlier in the file it should be ignored. Im using ordered: true but need to ensure if newer values are favored over older ones.
The way I want to do this is by coveting the PID to a 3 part tuple and determine which thread is newer by its ID. I have noticed they seem to be some what sequential. The last number denoting something like a series.
That said I really need to understand how PIDs are generated to know if this is a viable option.
Trending in Questions
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
Hello,
I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
Hi everyone,
I am toying with the idea of building a “match maker” for giving personal help to people that wants to start coding.
I sta...
New
Documentation
While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
So my question is quite simple and i have found no conclusive answer on forum, google or AI.
Should we use :erlang.float for Integer to ...
New
I recently noticed that Elixir’s Logger defaults its primary log level to :debug when no :logger, :level application configuration is pre...
New
I’m new to elixir and just tried to install the elixirLS extension for VScode(ium) and it is throwing some errors that I would like help ...
New
Other Trending Topics
Edit: 2026 May 15 - This post is archived.
Mob is alive!!
Main docs: mob v0.7.11 — Documentation
A bit of explanation for the slightly c...
New
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Hi everyone!
The first release candidate for the Expert language server project is now available!
We’ve published a press release detai...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #ai
- #elixirconf-us
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #elixirconf-eu
- #metaprogramming
- #hex










Showing Posts 1 to 6- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
kip
The PID format is opaque so likely to cause issues if you rely upon some expectation. Maybe you could
Stream.with_index/1the list of files into yourTask.async_stream/5so that you know the order definitively?dimitarvp
No, you really don’t. If a type’s values are opaque that should give you a hint you are focusing on the wrong imagined solution.
Can you please describe your exact problem? I can’t understand by your explanation. You want things coming in an ordered fashion but since each “thing” (a file?) has a different size you are worried the smaller ones will finish first regardless, or?
Can you tell us more about what you want to do?
benwilson512
Yeah as @dimitarvp notes this is not a viable option. Pid values are not guaranteed to be ordered. They may appear to be for a while, but as the system goes on it’ll start reusing numbers from earlier dead pids and the order will be lost.
Can you show the code you’re doing?
zoten
I’d go to the solution of giving an additional index as input to the task themselves, so they can return it along with the result and you can order them by it if you really need it.
Just to add to the already mentioned problems with using an opaque data to yield information, afaik the first number in the PID’s triple is the node number, but I’m unaware about the others
lud
You can use
Enum.with_index/1on your data before calling in async stream.rvirding
What the fields in a pid mean is an internal an implementation detail and it is upto the implementation to decide and interpret their meaning. For the sake of compatibility there will always be 3 fields. The only thing you can more or less with certainty get out of pid is the meaning of the first field, if it is
0it is the pid of a local process otherwise it is a process on another node. There is no way to work out on which node by the value of the first field, except for0. The only real way to get the node is to usenode(pid).You have the same issue with references and ports as well.