Swiftpack.co - Macro-swift/MacroXmlRpc as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by Macro-swift.
Macro-swift/MacroXmlRpc 1.0.0
XML-RPC support for MacroExpress (Swift XML-RPC servers)
⭐️ 2
🕓 1 year ago
linux macOS iOS
.package(url: "https://github.com/Macro-swift/MacroXmlRpc.git", from: "1.0.0")

Macro XML-RPC

XML-RPC support for MacroExpress.

This is covered in the Writing an Swift XML-RPC Server blog entry.

What does it look like?

#!/usr/bin/swift sh
import MacroExpress // @Macro-swift
import MacroXmlRpc  // @Macro-swift

let app = express()

app.route("/RPC2")
   .use(bodyParser.xmlRpcCall())
   .rpc("ping") { _ in "pong" }
   .rpc("add")  { ( a: Int, b: Int ) in a + b }
   .use(xmlrpc.introspection())

app.listen(1337)

Environment Variables

  • macro.core.numthreads
  • macro.core.iothreads
  • macro.core.retain.debug
  • macro.concat.maxsize
  • macro.streams.debug.rc
  • macro.router.debug
  • macro.router.matcher.debug
  • macro.router.walker.debug

Async/Await

This doesn't support async/await yet as proper streaming would require custom executors. Which are not yet available.

Maybe a temporary measure would be appropriate just for XML-RPC (which rarely has streaming consumers/producers).

Links

Who

Macro XML-RPC is brought to you by the Helge Heß and ZeeZide. We like feedback, GitHub stars, cool contract work, presumably any form of praise you can think of.

There is a #microexpress channel on the Noze.io Slack. Feel free to join!

GitHub

link
Stars: 2
Last commit: 1 year ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Release Notes

OneOO
1 year ago

Updated to use the latest SwiftNIO. This implies that Swift 5.5.2+ is now required.

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