dkataskin / erlazure

Windows Azure Erlang bindings
BSD 3-Clause "New" or "Revised" License
35 stars 53 forks source link

Remove usage of `gen_server`? #40

Closed thalesmg closed 3 months ago

thalesmg commented 4 months ago

Hi! Thanks for your work on this library! :beers:

I'm evaluating this library for usage in our project, and I noticed that apparently there's no strict need to use a gen_server for the API calls to Azure. From what I could understand, it appears to me that the only goal of using a gen_server process is to hold the credentials in its state. Please correct me if I'm mistaken. :sweat_smile:

Would you be willing to accept future PRs that remove the use of gen_server and instead just uses a context map or record to hold the necessary info?

For example:

start(Account, Key) ->
    %% maybe wrap `Key` in a function to avoid printing
    #{account => Account, key => Key, other_stuff => ...}.

With this, there's no more need to serialize all calls through a single process, nor the need to add it to any supervision tree.

And since we are on the acceptable PR topic, would you be willing to accept PRs that format the source code using erlfmt?

thalesmg commented 4 months ago

Hi @dkataskin ! Have you had the opportunity to consider this? :smiley_cat:

thalesmg commented 4 months ago

@dkataskin would you be willing to accept PRs that remove this usage?

dkataskin commented 3 months ago

@thalesmg Yes, I think it makes sense.

thalesmg commented 3 months ago

Awesome! I'll try to prepare a couple PR in the coming weeks. Thanks! :beers: