Search results for flush
StringIO.flush/1 (function)
Flushes the output buffer and returns its current contents.
Examples - StringIO.flush/1 (function)
iex> {:ok, pid} = StringIO.open("in") iex> IO.write(pid, "out") iex> StringIO.flush(pid) "out" iex> StringIO.contents(pid) {"in", ""}
Example - Port (module)
...command, "hello"}}) iex> send(port, {self(), {:command, "world"}}) iex> flush() {#Port<0.1444>, {:data, "hello"}} {#Port<0.1444>, {:data, "world"}} ...
spawn_executable - Port (module)
...Port.open({:spawn_executable, path}, [:binary, args: ["hello world"]]) iex> flush() {#Port<0.1380>, {:data, "hello world\n"}} When using `:spawn_executable`, ...
spawn - Port (module)
...irectly: iex> port = Port.open({:spawn, "echo hello"}, [:binary]) iex> flush() {#Port<0.1444>, {:data, "hello\n"}} `:spawn` will retrieve the program nam...
State - Processes (extras)
...62.0>} iex> send(pid, {:get, :hello, self()}) {:get, :hello, #PID<0.41.0>} iex> flush() nil :ok ``` At first, the process map has no keys, so sending a `:get` message...
Sending and receiving messages - Processes (extras)
...essage. While in the shell, you may find the helper `flush/0` quite useful. It flushes and prints all the messages in the mailbox. ```elixir iex> send(self(), :hello...
Examples - Task.Supervisor.async_nolink/3 (function)
...) do # We don't care about the DOWN message now, so let's demonitor and flush it Process.demonitor(ref, [:flush]) # Do something with the res...
Message and function APIs - Port (module)
...eady closed, the port will reply with `{port, :closed}` message once it has flushed its buffers and effectively closed. See `close/1`. * `{pid, {:connect, n...
The need for monitoring - Client-server communication with GenServer (extras)
...} iex> Process.monitor(pid) #Reference<0.0.0.551> iex> Agent.stop(pid) :ok iex> flush() {:DOWN, #Reference<0.0.0.551>, :process, #PID<0.66.0>, :normal} ``` Note `Proc...
Our first distributed code - Distributed tasks and tags (extras)
...end) #PID<9014.59.0> iex> send(pid, {:ping, self()}) {:ping, #PID<0.73.0>} iex> flush() :pong :ok ``` From our quick exploration, we could conclude that we should use...