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.

Feature Request: async preprocess

See original GitHub issue

I’m trying to parse some minecraft NBT data with zod. However, in order to do this, one key of the object (item_bytes) first needs to be converted from the binary NBT format to a JSON-like structure.

The best way to implement this in my opinion would be to use zod’s z.preprocess(). Unfortunately, the library I’m using prismarine-nbt only exposes parse as an async function.

As far as I can tell, async preprocessing is not supported right now. I think it would be great if it’s allowed as it would really simplify parsing with async libraries.

I’d suggest either z.preprocess(async () => { /* ... */ }, z.any()) or z.preprocessAsync(async () => { /* ... */ }, z.any()) as I think either would be reasonable from an API standpoint.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
colinhackscommented, Mar 21, 2022

Yep, seems like an oversight, should be a quick addition. I’ll look into it.

0reactions
FlorianWendelborncommented, Nov 18, 2022

@stale don’t

Read more comments on GitHub >

github_iconTop Results From Across the Web

Asynchronous inference - Amazon SageMaker
Amazon SageMaker Asynchronous Inference is a new capability in SageMaker that queues incoming requests and processes them asynchronously.
Read more >
Feature preprocessing overview | BigQuery ML - Google Cloud
Feature preprocessing is one of the most important steps in developing a machine learning model. It consists of the creation of features as...
Read more >
Support for creating asynchronous endpoints with my ... - GitHub
I would like to create an asynchronous inference endpoint with my own model, preprocessing and inference code with the SageMaker middle-level ...
Read more >
Run Async Requests with the Batch Endpoint Guide - Mailchimp
Depending on your server language or architecture, you may not want a request to the Marketing API to block other threads. Batch requests...
Read more >
4483 - Feature Request: Support async/await functions - v8
I actually think stepping for generators are fine, but for async funcions are not. Generators expose its resumable behavior via yield expression, which...
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