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 async in added globals

See original GitHub issue

Hi there,

Is it possible to create globals that support coroutines?

for example:

edge.global('test', async function () {
  return await asyncFunc()
})

Thank you

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
nrempelcommented, Dec 25, 2017

Ah, ok. That does sounds like more effort than it’s worth.

I will find another way to inline the css.

Thank you!

1reaction
thetutlagecommented, Dec 25, 2017

@nrempel Nope, adding asynchronous support is way more work than it seems.

  1. It will be a breaking change.
  2. Internal loops have to be async friendly.
  3. Add support for async/await keyword within templates.

More than all the work, it is not something I want to add, since async templates are harder to debug.

Also as you said, inlining the css within your controller, or whatever code that renders the view is way to go

Read more comments on GitHub >

github_iconTop Results From Across the Web

javascript - Set value of global variable inside async function ...
Firstly I want to ask if this is possible or not,Setting value to global variable inside async function or promise?
Read more >
How to set a global variable from an async function? - Reddit
How to set a global variable from an async function? getMetadata(acc1) returns an array asynchronously: [1,2,3] ...
Read more >
The problem with Flask async views and async globals
The simple explanation is that Flask uses WSGI to service HTTP requests and responses which doesn't support asynchronous I/O. Asynchronous code ...
Read more >
Are global variables okay to use in asynchronous programs?
Modifying a variable on one thread and reading it on another is always problematic. Modifying it on two threads is worse. You can...
Read more >
Global - Documentation
An "async function" in the context of Async is an asynchronous function with a variable number of parameters, with the final parameter being...
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