Discussion:
[Twisted-Python] Deferring 201 status code
Vikas Kumar
2015-06-23 17:17:06 UTC
Permalink
Hi,

My controller code first updates DB and then sends out 201 status code
indicating it is done updating in DB.
Issue is somebody waiting to fetch this update from DB will not work
immediately because DB update takes some time(approximately 0.5 second) to
come into effect.

Is there a way I can control/defer sending out 201?
Any sample code/link will be appreciated.

Regards
Vikas
Glyph
2015-06-24 01:36:18 UTC
Permalink
Hi,
My controller code first updates DB and then sends out 201 status code indicating it is done updating in DB.
Issue is somebody waiting to fetch this update from DB will not work immediately because DB update takes some time(approximately 0.5 second) to come into effect.
Is there a way I can control/defer sending out 201?
Any sample code/link will be appreciated.
Regards
Vikas
Can you supply an <http://sscce.org <http://sscce.org/>> that demonstrates your problem? There are definitely solutions but it sort of depends on exactly how you want this to work. Also, what database are you using?

-glyph

Loading...