Swiftpack.co - swift-libp2p/swift-libp2p-mplex as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by swift-libp2p.
swift-libp2p/swift-libp2p-mplex 0.1.1
A LibP2P Stream Multiplexer Protocol
⭐️ 0
🕓 2 weeks ago
iOS macOS
.package(url: "https://github.com/swift-libp2p/swift-libp2p-mplex.git", from: "0.1.1")

LibP2PMPLEX

Swift Package Manager compatible

A LibP2P Stream Multiplexer protocol

Table of Contents

Overview

Mplex is a Stream Multiplexer protocol. The origins of this protocol are based in multiplex, the JavaScript-only Stream Multiplexer.

Mplex is a very simple protocol that does not provide many features offered by other stream multiplexers. Notably, mplex does not provide backpressure at the protocol level.

Note:

Install

Include the following dependency in your Package.swift file

let package = Package(
    ...
    dependencies: [
        ...
        .package(url: "https://github.com/swift-libp2p/swift-libp2p-mplex.git", .upToNextMajor(from: "0.1.0"))
    ],
        ...
        .target(
            ...
            dependencies: [
                ...
                .product(name: "LibP2PMPLEX", package: "swift-libp2p-mplex"),
            ]),
    ...
)

Usage

Example


import LibP2PMPLEX

/// Tell libp2p that it can use mplex...
app.muxers.use( .mplex )

API

Not Applicable

Contributing

Contributions are welcomed! This code is very much a proof of concept. I can guarantee you there's a better / safer way to accomplish the same results. Any suggestions, improvements, or even just critques, are welcome!

Let's make this code better together! 🤝

Credits

This repo is just a gnarly fork of the beautiful http2 code by the swift nio team below...

License

MIT © 2022 Breth Inc.

GitHub

link
Stars: 0
Last commit: 6 hours ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics