Jon Favreau stumbled upon the plot for his newest film, “Chef” — about a disgraced culinary chief-turned-triumphant food truck owner — while meditating. The film, which Favreau wrote, starred in, co-produced and directed, bows in limited release May 9.

The chef in the film is undone by his tweets. Why do social media, specifically Twitter, play such a large role in this film?

In “Swingers” the answering machine was a character, and I feel like the tech that we interact with every day are like characters. Our engagement with social media (informs) the plot of the film and how my character ends up ultimately being his own worst enemy.

Is technology an enemy?

Some of my best friends are my tech devices. It’s not quite “Her,” but I really feel lonely if I don’t have my phone.

Why a film with food at the center?

There was something about a tattooed, volatile chef — a father and a guy who lost his way — dealing with the archetypical (food) reviewer that made me stop meditating and write an eight-page outline. Plus filming food is hypnotic to me.

You haven’t worn so many hats on a film since “Swingers.”

It was a real treat, but the movie business is changing. It’s harder and harder to get a movie about real people and day-to-day life on the bigscreen. I don’t know if in another 10 years, when I’m 57, if that’s something I could still do.