Venice  by Zewo

Swift concurrency library for macOS and Linux

Created 10 years ago
1,500 stars

Top 27.6% on SourcePulse

GitHubView on GitHub
1 Expert Loves This Project
Project Summary

Venice provides structured concurrency and Communicating Sequential Processes (CSP) for Swift developers on macOS and Linux. It aims to simplify concurrent programming by ensuring that the lifetimes of concurrent operations are cleanly nested, preventing orphaned background tasks and offering robust cancellation mechanisms.

How It Works

Venice wraps a fork of the C library libdill, leveraging its capabilities for coroutines, channels, and file descriptor polling. Its core design principle is structured concurrency, where child coroutines must complete before their parent coroutines finish, creating a predictable call-tree-like execution flow. This is enforced through explicit cancellation, which propagates errors (VeniceError.canceledCoroutine) through blocking calls, enabling graceful resource cleanup via defer statements.

Quick Start & Requirements

  • Installation: Requires installing a libdill fork via brew install zewo/tap/libdill (macOS) or adding apt.zewo.io and sudo apt-get install libdill (Linux). Venice is then added as a dependency in Package.swift.
  • Dependencies: Swift, libdill fork.
  • Documentation: Venice API reference

Highlighted Details

  • Provides coroutine cancellation and coroutine groups.
  • Supports channels, receive-only channels, and send-only channels.
  • Includes file descriptor polling for I/O operations.
  • Enforces structured concurrency, guaranteeing encapsulation of concurrent tasks.

Maintenance & Community

The project appears to be part of the Zewo ecosystem, though recent activity and specific maintainer details are not explicitly stated in the README.

Licensing & Compatibility

  • License: MIT License.
  • Compatibility: Suitable for commercial use and linking with closed-source projects.

Limitations & Caveats

Coroutines are strictly bound to the thread they are created on, and handles (like channels) cannot be shared across threads, limiting cross-thread communication patterns.

Health Check
Last Commit

6 years ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
1 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.