[erlang-questions] Fire and Forget

Felix Gallo <>
Fri Apr 1 18:44:02 CEST 2016


I accidentally once destroyed a 50 machine php http api cluster by pointing
a single four core erlang instance at it and making requests as fast as I
could go. You may wish to build rate limiting and error handling in from
the start instead of ignoring the response.

F.
On Apr 1, 2016 9:14 AM, "Steven Livingstone" <> wrote:

> Thanks Paul. It was more that as i would be just logging lots of data,
> if some gets lost it is ok, hence it doesn't need to wait on a 200.
>
> So, I guess it was how to optimise under those conditions, but perhaps
> doing an async post and later getting a 200, even if it is just a "all
> is ok" even if i don't intend to do anything beyond that may be a
> sensible approach anyway.
>
> Restart temporary under supervisor sounds good - i mainly don't want
> to block anything. Unfortunately I come with the burden of years of
> procedural programming so my mindset is still adjusting to the fact
> spinning up many processes is a good thing in erlang.
>
> It may be I should be passing the data using something other than an
> HTTP POST and more erlang-like but one step at a time :-)
>
> regards,
> steven
>
> On Fri, Apr 1, 2016 at 4:55 PM, Paul Peregud <>
> wrote:
> > Low complexity solution: just spawn a process which will send request
> > and terminate.
> > More complex solution: spawn process under supervisor. Restart
> > strategy "temporary" is a good fit. Or "transient" if you want to
> > restart failed attempts.
> >
> > As for "response never happens". Do you mean that server does not
> > return anything ever? Not even HTTP 200 OK? Just holds up connection?
> >
> > On Fri, Apr 1, 2016 at 5:18 PM, Steven Livingstone <>
> wrote:
> >> Hi all, Erlang newbie here. So, hello all :-) Now,
> >>
> >> I wish to do a fire and forget http post in Erlang.
> >>
> >> I looked at the httpc module which seems to allow synchronous and
> >> asynchronous calls but in the latter case i do not expect a return
> >> value so don't need a request id .... and not sure whether that
> >> behaviour influences what I want ... does it hold open a connection or
> >> use up resources on a response that is never going to happen etc.
> >>
> >> Does anyone know the best approach?
> >>
> >> many thanks,
> >> steven
> >> _______________________________________________
> >> erlang-questions mailing list
> >> 
> >> http://erlang.org/mailman/listinfo/erlang-questions
> >
> >
> >
> > --
> > Best regards,
> > Paul Peregud
> > +48602112091
> _______________________________________________
> erlang-questions mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-questions
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20160401/5a667087/attachment.html>


More information about the erlang-questions mailing list