Quantcast
Channel: Photon Server — Photon Engine
Viewing all articles
Browse latest Browse all 1557

Info.Defer and regaining thread safety

$
0
0
I am under the impression that when you want to make an HTTP request as per the example, you do info.Defer() and then in the callback you do if deffered, info.Conitnue. This then probably makes it safe to do photon activity(Please correct me if I am wrong).

However what If i need a 2nd defer or do not want to continue but need to do logic. Example

1)OnEvent
2)Http request, defer
3)Callback received
4)Need to do stuff (cannot do continue here because we are in a fail or cancel situation but it is not determined yet which one it is)
5)Another http request(Do I defer again?)
6)Callback received
7)If all good: info.Cancel(because all messages are private I do not want them going to the other clients)
else info.Fail

So question 1) after a defer can you do stuff without calling cancel\continue etc
question 2) can you defer a 2nd time?
question 3) can you defer and then cancel to hide the message from other clients?

Thanks!

Viewing all articles
Browse latest Browse all 1557

Trending Articles