Latest 2.0.0
Homepage https://github.com/vknabel/QueuedNet
License MIT
Platforms ios 8.0, osx 10.9, watchos 2.0, tvos 9.0
Authors

QueuedNet is a Swift framework to parallelize applications more declaratively.

Example

enum Test: String, Printable, NetNodeRawType {
    case a, b, c, d

    var description: String { return self.rawValue }
}

let net = Net<Test>(initials: [.a]) { builder in
    builder.addTransition(from: [.a], to: [.b, .c], perform: { _ in
        println("t1")
      }, error: { _ in
        print("e1")
    })
    builder.addTransition(from: [.b, .c], to: [.d], perform: { _ in
        println("t2,3")
      }, error: { _ in
        print("e2")
    })
}

Terms

Term Type Description
Net Net Contains all nodes.
Builder NetBuilder Used to build nets.
Node NetNode Usually build with an enum type, e.g. .StoringImage.
Transition NetTransition Connections between nodes.
Node State NetNodeState One of .Ready, .Running, .Finished, .Triggered, .Error
Transition Handler NetTransition -> Void Will be run if its transition’s input nodes’ states are all set to .Triggered. Will be called in the transition’s queue.
Error Handler NetNode -> Void Will be run if one of its transition’s input node’s state is set to .Error. Will be called in the transition’s queue.
State Handler NetNode -> Void Will be called in a set queue if a node .
Queue NSOperationQueue Queues run in their own thread, hence parallel.

Latest podspec

{
    "name": "QueuedNet",
    "version": "2.0.0",
    "summary": "QueuedNet is a Swift framework to parallelize applications more declaratively.",
    "description": "QueuedNet is a Swift framework to parallelize applications more declaratively and is comparable to a Petri Net.",
    "homepage": "https://github.com/vknabel/QueuedNet",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Valentin Knabel": "[email protected]"
    },
    "source": {
        "git": "https://github.com/vknabel/QueuedNet.git",
        "tag": "2.0.0"
    },
    "platforms": {
        "ios": "8.0",
        "osx": "10.9",
        "watchos": "2.0",
        "tvos": "9.0"
    },
    "source_files": "Sources/QueuedNet/*.swift"
}

Pin It on Pinterest

Share This