4
0
Fork 0

Added section readme on async

indexed
hswick 6 years ago
parent d40fa1a6de
commit 18b4d34bb6
  1. 9
      README.md

@ -89,6 +89,15 @@ iex(11)> ExW3.Contract.call(:SimpleStorage, :get)
{:ok, 1} {:ok, 1}
``` ```
## Asynchronous
ExW3 now provides async versions of `call` and `send`. They both return a `Task` that can be awaited on.
```elixir
t = ExW3.Contract.call_async(:SimpleStorage, :get)
{:ok, data} = Task.await(t)
```
## Listening for Events ## Listening for Events
Elixir doesn't have event listeners like say JS. However, we can simulate that behavior with message passing. Elixir doesn't have event listeners like say JS. However, we can simulate that behavior with message passing.

Loading…
Cancel
Save