0

I am working on a script. The script includes some functions. Every function has one url packet that query the server. The server returns the data in JSON format. To use this data I have included the JSON library.

The problem I am facing is each function calls the next function after it finishes executing its body.

Like:

When Function1 Finishes it calls function2
when Function2 Finishes it calls Function3...and so on

So in-between if one of the function fails the script stops executing further.

I have research about this on Google and found out that i have to implement a circular buffer but couldn't find any good example of it.

One of my friend pointed out me that call functions recursively is very bad idea. Is that right?

2
  • It sound like your question is similar to this stackoverflow.com/q/27170825/234175. Commented Jan 17, 2015 at 4:54
  • @celeritas When improving a lua-tagged question, please make sure to update "LUA" to "lua" or "Lua". Commented Jan 17, 2015 at 9:03

1 Answer 1

0

It sounds like you're talking about a ring buffer. You can find an example implementation here.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.