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 4.7.5
Near Procedure Call.
⭐️ 0
🕓 1 year ago
iOS macOS watchOS tvOS
.package(url: "https://github.com/neutronstarer/npc_swift.git", from: "4.7.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 year ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

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