Closed ericgj closed 12 years ago
I agree, the "one request, one response" model has its limitations. That said, I'm still trying to hit them head on via a real use case rather than conduct thought experiments to influence the design. Still, the scenarios you brought up are worth discussing.
1) I'm not interested in that use case. Using Mail gem directly seems to solve that problem, or just using Newmail::Mailer.deliver_mail if you wanted to piggyback off of Newman's configuration system.
2) I can't think of a practical example, do you have one?
3) I think this can be done if you make it so the application is essentially just a capturing mechanism, and then stores the data in a Newman::Store. Then, a cron job could fire a script which uses a combination of Newman::Mailer and Newman::Store to generate the digest. That may well be cumbersome, and building it may teach us how to improve the underlying system.
Closing and marking as a design issue, will re-open if we come across a clear solution to these problems.
Examples for 2),
None of them significant enough to worry about now, I agree.
I wanted to have something like a skip_response
which would disable mail delivery. It sounds like this is something that may solve all the issues you outlined, and I don't think it will be that hard to implement. What do you think?
Yes, exactly where I was headed. if you want I could have a crack at that too.
Go for it. I'll open a ticket an assign it to you.
Right now the server model is single-request, single-response. It's easy to think of other use-cases that don't fit this model: for instance
None of these seem high priority for us, in fact I'd be happy never to build a platform for spam (#1) :)
But something to consider at some point whether the app should have more control over the response flow, rather than the server.