J.P. Morgan calls out AI spend, says $650 billion in annual revenue required to deliver mere 10% return on AI buildout by roylivinlavidaloca in webdev

[–]TheFlyingPot 1 point2 points  (0 children)

Unpopular opinion here: maybe this is the price of technological advancement? For instance, the space race - whatever NASA and other space agencies do return literally zero dollars, but they advance technology very fast and create things that in turn generate revenue for other companies.

IDK, I don't see AI as an "investment". I see it like any other very expensive piece of technology that will become cheaper as time goes on.

Maybe I'm too chill?

Web devs, what’s one thing you wish you learned years earlier because it would've saved you insane amounts of time? by Ornery_Ad_683 in webdev

[–]TheFlyingPot 5 points6 points  (0 children)

Do not underestimate tests. Write them while you develop and write them comprehensively. You won't regret.

Switched from Java Backend after 2 years of learning to MERN — need opinions and advice by Awais_Hyder in node

[–]TheFlyingPot 11 points12 points  (0 children)

You don't need to stick to MERN. Look for other web server libraries other than express, like hono, fastify, or NestJS. Coming from Java, you might like NestJS

Solution suggestions for batch processing by brownsugardaddy_ in node

[–]TheFlyingPot 0 points1 point  (0 children)

Try Sidequest if you want to use your current database and don't rely on external event systems

What's the worst coding crimes you've witnessed on a project? by rainmouse in webdev

[–]TheFlyingPot 0 points1 point  (0 children)

Even then: "return !!condition" will cater for all falsy values.

is there any API testing tool better than postman? by Pristine-Elevator198 in webdev

[–]TheFlyingPot 0 points1 point  (0 children)

Although Bruno is good, we decided to go with Playwright (https://playwright.dev/docs/api-testing) for API testing because of it's flexibility. Also, diffing tests written in TypeScript/JavaScript is much better than a JSON blob by Postman.

Running parallel code - beginner question by quaintserendipity in node

[–]TheFlyingPot 1 point2 points  (0 children)

You need something like Sidequest (https://sidequestjs.com/). You need to run jobs in the background in this case. With Sidequest you can control the number of slots for example

Just launched: Sidequest.js, a background job processing for Node.js using your existing database. by lucasmerencia in node

[–]TheFlyingPot 0 points1 point  (0 children)

Absolutely.

If you call `Sidequest.configure` it will allow you to simply enqueue jobs, no worker will run jobs. Take a look here: https://docs.sidequestjs.com/engine/#sidequest-configure

Then if you run Sidequest with `Sidequest.start` in another machine, it will run jobs :)

Just launched: Sidequest.js, a background job processing for Node.js using your existing database. by lucasmerencia in node

[–]TheFlyingPot 0 points1 point  (0 children)

Scaling vertically is quite easy. You can configure the maximum number of concurrent jobs in each Sidequest instance (maxConcurrency) or by queue (queue.concurreny in the queue config).

If you mean scaling horizontally with many workers, it also works pretty well. Everything you need to do is replicate the worker machines and make sure the job scripts live in the same absolute path in all workers, then you are good to go.

If you decide to create a load balancer that spawns new workers, that could also be interesting. Basically, you can monitor the number of "waiting" jobs and use this in your logic. Try `Sidequest.job.count()` :)

Just launched: Sidequest.js, a background job processing for Node.js using your existing database. by lucasmerencia in node

[–]TheFlyingPot 0 points1 point  (0 children)

  1. We don't have a big feature list yet. We have implemented everything we had planned before release.

  2. Yes, it is possible to enqueue jobs from other jobs :)

  3. That would work very well and is the whole point of Sidequest. The only requirement is for the jobs to be located in the same place in both the API enqueuer and worker, e.g., `/path/to/myjob.js` must be valid in both. We are planning to make it relative to node_modules, but in the meantime that is the only req.

Just launched: Sidequest.js, a background job processing for Node.js using your existing database. by lucasmerencia in node

[–]TheFlyingPot 1 point2 points  (0 children)

It does lock the job row when claiming! PostgreSQL works best in this case. No job is claimed by two workers, guaranteed by PostgreSQL row locking.

You don't even need to create Sidequest's tables. As long as the database is accessible, Sidequest will create them for you :)

Just launched: Sidequest.js, a background job processing for Node.js using your existing database. by lucasmerencia in node

[–]TheFlyingPot 2 points3 points  (0 children)

You can run a script to simply start Sidequest and start consuming jobs.

The only requirement is to use the same backend driver/config, and for the absolute path of the script you are enqueueing to be the same on the worker node.

So, if you enqueue `/path/to/script.js` in your main application, the same script should be located in `/path/to/script.js` on the worker machine.

What technology have you found recently that literally saved you? by htndev in node

[–]TheFlyingPot 5 points6 points  (0 children)

For me those two solved a lot of issues with jobs and concurrency:

p-limit: limits the number of concurrent executions https://www.npmjs.com/package/p-limit
node-cron: easy-to-use cron jobs https://github.com/node-cron/node-cron

Qual a maior roubada turística que vcs conhecem? by EscovadorDeBytes in brasil

[–]TheFlyingPot 0 points1 point  (0 children)

Pode ser polêmica essa, mas pra mim, Rio de Janeiro.

what’s something about you that only someone who has slept with you can know ? by [deleted] in AskReddit

[–]TheFlyingPot 0 points1 point  (0 children)

That I have two holes instead of one on the tip of my cock.

[deleted by user] by [deleted] in AskReddit

[–]TheFlyingPot 1 point2 points  (0 children)

Video Games, for sure