question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support batches of synchronous operations

See original GitHub issue

As 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:open
  • Created 5 years ago
  • Reactions:2
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
RubenVerborghcommented, Jan 10, 2019

(@RubenVerborgh You’ve mentioned before that you don’t like the addPendingPromise, any other suggestions?)

.schedule

0reactions
rubensworkscommented, Jan 29, 2021

For reference: WeakRef has just been introduced: https://v8.dev/features/weak-references This would allow scope detection and help simplify batching operations.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found