jwsinner

jwsinner

Elixir Flow and Windows 10

I have a Flow setup that does a port scan on localhost to catch anything I currently have running:

    range
    |> Flow.from_enumerable()
    |> Flow.partition()
    |> Flow.map(fn port ->
      %URI{
        host: host,
        path: "/status",
        port: port,
        scheme: "http"
      }
      |> URI.to_string()
      |> IO.inspect() # <-- only here for troubleshooting, issue persists without it
      |> Req.get(retry: false)
      |> assign(port)
    end)
    |> Flow.reject(fn response -> Enum.empty?(response) end)
    ...

Whether or not I use Flow.partition() doesn’t seem to have an effect on it, but the IO.inspect() seems to be printing out 24 items at a time with a delay of about one second between printing. Putting Flow.from_enumerable(max_demand: 1) (something I saw on StackOverflow) doesn’t do anything to speed it up either.

When I run this same code on Ubuntu, the process completes in less than half a second. Is this an issue with how Windows allocates processes? Has anyone else experienced this with Flow? Or is this just poorly written code that Flow doesn’t know what to do with?

Where Next?

Popular in Questions Top

joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 records...
New
Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
pmjoe
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
dblack
I’ve got an issue with an app and I’ve no idea of how to troubleshoot it. I’m hoping someone here might have seen something similar. I p...
New

Other popular topics Top

Qqwy
Update: How to use the Blogs &amp; Podcasts section You can post links to your blog posts or podcasts either in one of the Official Blog...
3271 130579 1222
New
vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New
axelson
This post is a wiki (feel free to hit the edit button near the bottom right of this post to add your own changes!) This post collects co...
239 49134 226
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New

We're in Beta

About us Mission Statement