Похожие чаты

Should be easy to async parallel stuff right ?

7 ответов

5 просмотров

*Concurrent

go through the tour of go

Hassan-@odin88 Автор вопроса
Colossal Toaster
go through the tour of go

https://tour.golang.org/concurrency/1

Async? Yes. But goroutines can still be tricky, you will face almost the same challanges

package main import "fmt" func generator(start, end, sep int) chan int { o := make(chan int) go func() { defer close(o) for i:=start; i<end; i+=sep { o <- i } }() return o } func main() { for i := range generator(0, 10, 1) { fmt.Println(i) } }

Похожие вопросы

Обсуждают сегодня

А как старый хаскел с новым стыковать ? потому как тут работает https://play.haskell.org/saved/C3xpMzcd, а вот тут https://stepik.org/lesson/7602/step/9?unit=1473 нет ошибка C...
Fedor
131
Ребят, что лучше для реверса: гидра или ида?
En Vind Av Sorg
22
Вопрос я правильно понимаю что в коде newtype ArrowMap k v = ArrowMap { getArrowMap :: k -> Maybe v } getArrowMap есть функция типа k -> Maybe v, если да, то не понимаю задач...
Fedor
64
Делаю велосипед логгер. К сообщению хочу прикрутить некоторую информацию, типа, кем отправлено, какой уровень, и всякое такое. И тут подумалось мне, почему бы не хранить весь...
Serjone
24
Всем привет! Использую gitlab-ci. Настроил gitlab-agent для деплоя в куб. При деплое проекта в логах такая ошибка: Executing deploy plan failed to watch "ns:my-project/Ingress...
Konstantin Moiseev
4
For the people that think monero should be used solely as a currency and not as a security/asset, can y’all explain? In my opinion, Monero can be great at both
glen 🔟
12
Since this HBAR page is so sensitive to words and criticism, I'll have to put this more delicately. What's up with this? DBS, a Hedera GC member holding $647 million in ETH?...
Summit Seeker R
11
Как Вы считаете нормально ли в двадцатых годах 21 века в ВУЗах Российской Федерации обучать студентов работе с TASM? Не слишком ли это "архаично"? (Если оффтоп или флейм для э...
Spiker01
52
I am honored to report that all the deliverables for the BCHFAQ Flipstarter Phase 1 have been completed. I appreciate the opportunity I've had to put all this together using t...
fixthetracking
15
What do you think they are trying to do ?
Ronan Gill
15
Карта сайта