https://github.com/tylersamples/counter
Resource Objects in Rustler
https://github.com/tylersamples/counter
Last synced: 12 months ago
JSON representation
Resource Objects in Rustler
- Host: GitHub
- URL: https://github.com/tylersamples/counter
- Owner: tylersamples
- Created: 2021-04-17T04:51:50.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2021-04-20T18:54:13.000Z (about 5 years ago)
- Last Synced: 2025-06-08T22:01:47.251Z (about 1 year ago)
- Language: Elixir
- Size: 9.77 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Rustler Resource Objects Counter Example
Setup:
```
$ git clone git@github.com:tylersamples/counter.git && cd counter
$ mix deps.get
```
Using the counter:
```
iex(1)> Counter.new()
#Reference<0.3379365608.2720137221.242534>
iex(2)> counter = Counter.new()
#Reference<0.4020670021.1591345154.158521>
iex(3)> Counter.__info__(:functions)
[__init__: 0, decrement: 1, increment: 1, new: 0, read: 1]
iex(4)> counter |> Counter.increment() |> Counter.decrement() |> Counter.read()
0
```
More information can be found: https://smpls.dev/p/rustler-resources