Skip to content

Instantly share code, notes, and snippets.

@ifranseda
ifranseda / channel-example.swift
Created December 22, 2019 08:14 — forked from kainosnoema/channel-example.swift
Golang-like concurrency semantics in Swift
import Foundation
go(println("in a thread"))
// buffered channel
var c = Chan(buffer:20)
// sending routing
go {
while(true) {