jmap-client icon indicating copy to clipboard operation
jmap-client copied to clipboard

Study how we could add the possibility to execute multiple queries in one API call

Open ddolcimascolo opened this issue 8 years ago • 4 comments

The idea is to minimize roundtrips to the backend. The spec defines back references that can help for the implementation I suppose...

ddolcimascolo avatar Mar 06 '16 14:03 ddolcimascolo

If I got it well you mean doing stuffs like saveAsDraft and moveToOutbox in one roundtrip?

dbenchi avatar Mar 06 '16 16:03 dbenchi

Yes @abenchi. The spec defines back references so that you can reference an entity created earlier in the same jmap operation. This will look like this:

[ 
  [ "setMessages", { "create": { "clientIdForCreatedMessage": { ... } } }, "#0" ] 
  [ "setMessages", { "update": { "clientIdForMoveMessage": { "id": "#clientIdForCreatedMessage", mailboxIds: [...] } } }, "#1" ] 
] 

This will make both operations run in a single HTTP request, which is great as far as performance is concerned.

ddolcimascolo avatar Mar 12 '16 14:03 ddolcimascolo

And the server is soo performent that you can send him hundred of commands at once.

aduprat avatar Mar 12 '16 14:03 aduprat

great

dbenchi avatar Mar 12 '16 15:03 dbenchi