Support batches of synchronous operations
See original GitHub issueAs originally discussed in #5, the JS proxy does not allow non-asynchronous overriding of =
and delete
.
However, we could still make use of them by introducing the concept of batched operations.
Syntactical sugar
Some syntactical sugar for updates and deletes.
Update
data.user.name = 'Ruben';
Translation:
path.addPendingPromise(user.name.delete()) // This will have no effect if no previous value existed.
path.addPendingPromise(user.name.add('Ruben'))
(@RubenVerborgh You’ve mentioned before that you don’t like the addPendingPromise
, any other suggestions?)
data.pending
is an awaitable over all pending promises.
Delete
delete data.user.daughter;
Translation:
path.addPendingPromise(data.user.daughter.delete())
Batching
Batching allows multiple operations to be grouped together in a single SPARQL query, for improved efficiency.
// Do data things batched
data.batch((batch) -> {
batch.user.name = 'Ruben';
batch.user.brother.name = 'Niels';
batch.user.sister.name = 'Muriel';
delete batch.user.daughter;
});
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Document processing modes - Amazon Comprehend
Requests made with these operations are synchronous. Your application calls the operation and then waits for the response from the service. Using the...
Read more >Synchronous Batch | Routing API and Extended Routing API
Purpose. The Synchronous Batch endpoint allows you to submit a new batch for synchronous processing. It responds with a batch processing result ...
Read more >Synchronous batch operation in an async world. Is it possible?
Hi,. I have a situation where I am going to have the use select a series of thing they want to do. Each...
Read more >Batch Processing - Ads API - Google Developers
While most services provide synchronous APIs, requiring you to make a request ... BatchJobService supports all of the operations listed in MutateOperation ...
Read more >16. When to use synchronous, batch or bulk interface?
Bulk Processing Mode: These fields indicate two modes which are support with bulk version 1.0 and bulk version 2.0 only parallel mode is ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
.schedule
For reference:
WeakRef
has just been introduced: https://v8.dev/features/weak-references This would allow scope detection and help simplify batching operations.