Git Product home page Git Product logo

desolate's Introduction

desolate's People

Watchers

 avatar

desolate's Issues

Reservoir

Data structure that handle multiple topic stream

  • Reservoir, Multiple topic, multiple source / upstream, multiple downstream, single type broadcast stream.
  • Confluence , Merge combine stream.
  • Cascade, Merge concat stream.

Not sure whether the other two will come just yet or should be suspended to focus on optimizing current code

Bug / Enhancement: Use Desolate built-in Signal status as suppose to using custom state

Description

For some reason, I didn't use the built-in Signal status on each Desolated actors and declare unnecessary additional boolean state that require management myself. I should opt in using Signal as much as possible as it works nicely automatically and does not require manual state management.

Code mentioned

Solution

  • Removed NonStop from Jet and use the Signal
// (removed) private var closed: Bool = false

public var status: Signal = .running
private var flows: [UUID: Flow] = [:]

/// Interface for Desolate
public func onMessage(msg: Act) async -> Signal {
    // (removed) guard !closed else { return same }

    switch msg {
    case .next(let message):
        for nozzle in flows.values {
            await nozzle.task(with: message)
        }
    case .complete:
        // (removed) closed = true
        for queue in flows.values {
            await queue.task(with: nil)
        }
        flows.removeAll()
        return .stopped
    case .attach(let id, let nozzle):
        flows[id] = nozzle
    case .detach(id: let id):
        flows.removeValue(forKey: id)
    }
    return .running
}

Removed usage on `fatalError` and unsafe mutability

Descriptions

Removed usage of any fatal error and unsafe mutations to prevent unsuspecting exceptions and behavior

Code references

Fatal Error

Unsafe mutation

Renamed Jet stream

Jet stream is a pretty unique name to call a reactive stream but it's not that descriptive. There are plenty of names that would fit better and explain the use of the data structures.

Bug: Nozzle AsyncSequence delay

At the moment, Nozzle delay request to the Current for new data, but the delay is static and doesn't scale with the computing power.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.