Swiftpack.co - avito-tech/EmceePluginSupport as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by avito-tech.
avito-tech/EmceePluginSupport 18.0.0
Swift package that allows to extend Emcee with plugins
⭐️ 1
🕓 6 weeks ago
.package(url: "https://github.com/avito-tech/EmceePluginSupport.git", from: "18.0.0")


This module provides a basic class that plugin can use to create a bridge between the worker and the plugin. All events are broadcasted into running plugins, but not backwards. The worker will start web socket server, the plugin subprocess, and then disconnect. Plugin is expected to terminate after its web socket disconnect. Worker will forcefully terminate it after some timeout if it stays alive.

Main Executable     ----- (web socket) ------->     Plugin

Using Plugin

In your Package.swift, import the library that has all required APIs to implement a plugin. Please use the matching Emcee version as a tag:

dependencies: [
    .package(url: "https://github.com/avito-tech/EmceePluginSupport", .revision("18.0.0"))

In your plugin target add EmceePlugin dependency:

targets: [
        name: "MyOwnPlugin",
        dependencies: [

The main class for plugin is Plugin. The most common scenario is (main.swift):

import Foundation
import EmceePlugin
import EmceePluginModels

func main() throws -> Int32 {
    let plugin = try Plugin { (event: PluginAppleTestEvent) in
        // process an event
    return 0

exit(try main())

Plugin class will automatically stop streaming events when web socket gets disconnected, allowing join() method to return.


Stars: 1
Last commit: 4 weeks 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