profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/safwank/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.
Safwan Kamarrudin safwank @dixahq Melbourne, Australia

safwank/ElixirRetry 332

Simple Elixir macros for linear retry, exponential backoff and wait with composable delays

safwank/FilmoMeter 1

An extremely simple Android application that aggregates movie ratings from various sources, normalizes them and calculates the average score.

safwank/FilmoMeterMachine 1

Erlang version of FilmoMeter, powered by WebMachine.

safwank/absinthe 0

The GraphQL toolkit for Elixir

safwank/awesome-elixir 0

A curated list of amazingly awesome Elixir and Erlang libraries, resources and shiny things. Updates:

safwank/ChatCowboy 0

A simple but secure chat server written in Elixir

safwank/clickingbad 0

Official Clicking Bad Repository

issue closedsafwank/ElixirRetry

Create github actions to validate tests and coverage upon PRs

Github can run tests and check the coverage blocking/allowing PR to be merged. I think it should be added (it’s extremely simple, feel free to assign the task to me.)

closed time in a day

am-kantox

issue commentsafwank/ElixirRetry

Create github actions to validate tests and coverage upon PRs

After merging your change yesterday I realised the Travis build was no longer working, so I migrated it to GitHub Actions which you can see in action here.

am-kantox

comment created time in a day

push eventsafwank/ElixirRetry

Safwan Kamarrudin

commit sha 1e9572c794e6e3d2648398a9686f31a56072312d

Fix build badge

view details

push time in a day

push eventsafwank/ElixirRetry

Safwan Kamarrudin

commit sha 8f7408b0e3086d64573ada5e5e597c038e622986

Update README with new build badge and version

view details

push time in a day

release safwank/ElixirRetry

v0.15.0

released time in a day

created tagsafwank/ElixirRetry

tagv0.15.0

Simple Elixir macros for linear retry, exponential backoff and wait with composable delays

created time in a day

delete branch safwank/ElixirRetry

delete branch : v0.15-prep

delete time in a day

push eventsafwank/ElixirRetry

Safwan Kamarrudin

commit sha 754c1997426cc4772a96f4488bdaa93fdd1a42a7

v0.15 release prep and workflow (#45) * Update dev and test deps * Add release workflow

view details

push time in a day

PR merged safwank/ElixirRetry

v0.15 release prep and workflow
+65 -17

0 comment

4 changed files

safwank

pr closed time in a day

PR opened safwank/ElixirRetry

v0.15 release prep and workflow
+65 -17

0 comment

4 changed files

pr created time in a day

push eventsafwank/ElixirRetry

Safwan Kamarrudin

commit sha 3b1b45ef71c31ff9ef65587a002e6a961f3353d4

Add release workflow

view details

push time in a day

create barnchsafwank/ElixirRetry

branch : v0.15-prep

created branch time in a day

delete branch safwank/ElixirRetry

delete branch : add-github-actions

delete time in a day

push eventsafwank/ElixirRetry

Safwan Kamarrudin

commit sha cfe47fb7b4e0dd50d72da857a9aa330e6b98dc0a

Add GitHub actions (#44) * Initial build file * Fix versions * Include OTP and Elixir versions in cache key * Remove restore key * Remove Travis build * Update min and current versions * Fix version

view details

push time in a day

PR merged safwank/ElixirRetry

Add GitHub actions
+47 -29

0 comment

5 changed files

safwank

pr closed time in a day

push eventsafwank/ElixirRetry

Safwan Kamarrudin

commit sha 6f22b11895b55175affcff6ae88d023669ddc27a

Fix version

view details

push time in a day

push eventsafwank/ElixirRetry

Safwan Kamarrudin

commit sha 466eb312dafc414c99609f07198a08494dbb9b37

Update min and current versions

view details

push time in a day

push eventsafwank/ElixirRetry

Safwan Kamarrudin

commit sha 895f1ed3372309466508b89c3f6fc2c75f6b5e17

Remove Travis build

view details

push time in a day

push eventsafwank/ElixirRetry

Safwan Kamarrudin

commit sha 41ea43625fd7aecf071d13ad9287d701684782f9

Remove restore key

view details

push time in a day

push eventsafwank/ElixirRetry

Safwan Kamarrudin

commit sha e8c2e8afc363aa5c4ebe80e5688ca8e8e921b3e1

Include OTP and Elixir versions in cache key

view details

push time in a day

push eventsafwank/ElixirRetry

Safwan Kamarrudin

commit sha 2ff597262d4fb9c16c52d079012318c30e36fe3b

Fix versions

view details

push time in a day

PR opened safwank/ElixirRetry

Add GitHub actions
+44 -4

0 comment

2 changed files

pr created time in a day

create barnchsafwank/ElixirRetry

branch : add-github-actions

created branch time in a day

push eventsafwank/ElixirRetry

Aleksei Matiushkin

commit sha 2979a0c08c272123aa4fadc44f70eb6877814b28

`reduce_while/3` allowing passing the accumulator through (#42) * reduce_while/3 allowing passing the accumulator through * retry_while/3 → retry_while/2 with an accumulator passed and handled as in for/1 * Changes according to PR

view details

push time in 2 days

PR merged safwank/ElixirRetry

`reduce_while/3` allowing passing the accumulator through

Th PR is inspired by this SO question.

In some cases, subsequent retries in reduce_while/2 might depend on the previous outcome. In such a case, it’d be great to pass the accumulator through instead of just discarding it. This PR provides reduce_while/3 allowing this functionality.

Example

    test "allows an accumulator to be passed through" do
      result =
        retry_while {:count, 0}, with: linear_backoff(50, 1) |> take(5) do
          {:cont, count + 1}
        end

      assert result == 6
    end
+84 -0

8 comments

2 changed files

am-kantox

pr closed time in 2 days

PullRequestReviewEvent

Pull request review commentsafwank/ElixirRetry

`reduce_while/3` allowing passing the accumulator through

 defmodule Retry do     end   end +  defmacro retry_while([with: stream_builder, acc: acc_initial], do: block),+    do: do_retry_value([acc: acc_initial, with: stream_builder], do: block)++  defmacro retry_while([acc: acc_initial, with: stream_builder], do: block),+    do: do_retry_value([acc: acc_initial, with: stream_builder], do: block)++  defp do_retry_value([acc: acc_initial, with: stream_builder], do: block) do

I think this can be simplified to

  defp do_retry_value([acc: acc_initial, with: stream_builder], do: block) do
    quote do
      unquote(delays_from(stream_builder))
      |> Enum.reduce_while(unquote(acc_initial), fn delay, acc ->
        :timer.sleep(delay)

        case acc do
          unquote(block)
        end
      end)
    end
  end

am-kantox

comment created time in 2 days

PullRequestReviewEvent

Pull request review commentsafwank/ElixirRetry

`reduce_while/3` allowing passing the accumulator through

 defmodule Retry do     end   end +  defmacro retry_while([with: stream_builder, acc: acc_initial], do: block),

How about simplifying this to the following?

  defmacro retry_while(args = [with: _stream_builder, acc: _acc_initial], do: block),
    do: do_retry_value(Enum.reverse(args), do: block)

  defmacro retry_while(args = [acc: _acc_initial, with: _stream_builder], do: block),
    do: do_retry_value(args, do: block)
am-kantox

comment created time in 2 days

pull request commentsafwank/ElixirRetry

`reduce_while/3` allowing passing the accumulator through

Love it. Yes please!

am-kantox

comment created time in 2 days