S
S
SKEPTIC2021-04-04 19:53:45
go
SKEPTIC, 2021-04-04 19:53:45

Asynchronous framework in golang?

I decided to delve into golang and write a small API purely for myself (to practice golang).

I searched the Internet, but for some reason I did not find an asynchronous framework or at least a web server for golang.

I considered gin (framework), but everything is synchronous there and only middleware can be made asynchronous. The problem was that the goroutine worked later than the web server returned the response.

Also considered net/http. I also did not find anything in it that would allow asynchronous processing of requests.

PS asynchrony is understood as the ability to run to a third-party api / to the base / yes, God, at least do time.Sleep () and that at that moment the web server can continue to process requests.

For example, node.js has it out of the box. In python, you have to get a little confused, but still.

In go (the very language that is positioned as

Compiled multithreaded programming language
this is stupidly not there (or not found, at least I did not find any articles, guides, or videos on this topic))

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
raiboon, 2021-04-04
@pro100chel

You just need to learn basic go and understanding will come. In your terminology, everything is already "asynchronous" - each request to the service will be processed concurrently, nothing special needs to be done.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question