Giter Club home page Giter Club logo

flux's People

Contributors

poying avatar vivektheone avatar yehohanan7 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

flux's Issues

Running client.http

Hi, sorry for the newbie question, but which software do you use to run the requests specified in client.http file? I saw that there was a package for emacs, but I'm wondering if there is any mac/homebrew app that performs these tasks?

Thanks,
Marcos

Feature: ProcessManager/Saga

I want to use aggregate and consumer to implement process manager. Can I add this feature to flux? Or I should do this in a separate repository to keep the project simple.

Support ledisdb

Ledisdb is more suitable for flux as it supports various data structures like List, Hash & Set etc.

[Help]Aggregate properties not updated after handling event. Probably me :(

Hi all, I've started playing around with the framework and found it nicely structured.
I'm having some difficulties on a rookie implementation. When my aggregate handle the event, the aggregate property loose its value. Any idea why?
Any help will be much appreciated. :)

The code:

package main

import (
	"fmt"

	"github.com/satori/go.uuid"
	"github.com/yehohanan7/flux"
	"github.com/yehohanan7/flux/cqrs"
)

//Object

type InventoryItem struct {
	cqrs.Aggregate
	Activated bool
}

func (ii *InventoryItem) Deactivate() error {
	if !ii.Activated {
		return fmt.Errorf("InventoryItem already deactivated")
	}
	ii.Update(InventoryItemDeactivated{}) //-> Trigger the Handle deactivated...
	//---> Activated is True
	return nil
}

//Events

type InventoryItemCreated struct {
	Id string
}

type InventoryItemDeactivated struct {
}

//Event handlers

func (ii *InventoryItem) HandleInventoryItemCreated(event InventoryItemCreated) {
	ii.Id = event.Id
	ii.Activated = true
}

func (ii *InventoryItem) HandleInventoryItemDeactivated(event InventoryItemDeactivated) {
	ii.Activated = false
	// --> Event is handled while doing the update and Activated properly set to False
}

func NewInventoryItem(id uuid.UUID) InventoryItem {
	inventoryItem := new(InventoryItem)
	var aggregateId = id.String()
	inventoryItem.Aggregate = cqrs.NewAggregate(aggregateId, inventoryItem, store)
	inventoryItem.Update(InventoryItemCreated{aggregateId})
	return *inventoryItem
}

var store = flux.NewMemoryStore()

func main() {
	inventoryItem := NewInventoryItem(uuid.NewV4())
	// Activated is true...
	inventoryItem.Deactivate()
	//Activated is true...
	inventoryItem.Save()
	// Activated is True...
	fmt.Println(inventoryItem.Activated)

}

Roadmap

I like the simple offset mechanism.
The boltdb stores also, as it's seamless to get going.
I am glad a cqrs system like this is being setup and could help.

I don't get why the readme says it's all about not needing Kafka and the roadmap says it will be incorporated.

I would like to see this design allow running everything in a single application, whilst using drivers to easily flip the system into a multi server solution. This is becoming pretty doable. I am on mobile right now but can send you some links later.

Store scaling

Rafty to the rescue ?

I did the same thing with boltdb, raft and serf.

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.