Swiftpack.co - neutronstarer/npc_swift as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by neutronstarer.
neutronstarer/npc_swift 1.0.5
Near Procedure Call.
⭐️ 0
🕓 1 week ago
iOS macOS watchOS tvOS
.package(url: "https://github.com/neutronstarer/npc_swift.git", from: "1.0.5")

npc_os

Near Procedure Call.

Usage

Create instance

let npc = NPC({message in 
    // send message to near npc
})

register handle

npc.on("ping") { param, notify, reply in
    // reply content
    reply("pong", nil)
    // return a cancel function which could be nil.
    return nil
}

deliver

n0.deliver("ping", param: nil, timeout: 0, onNotify: {param in
    // param is notification
}, onReply:{param, error in
    //param is repication
    //error is error-replication
})

More usage is in example app.

GitHub

link
Stars: 0
Last commit: 1 week 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