Worlds instead of (in addition to) Transactions


#1

Feature request.

Is there any interest in investigating/implementing a Worlds feature.

See
Worlds: Controlling the Scope of Side Effects

TL;DR
Basically nested transactions where queries return results from within the transaction.
Transaction aren’t separate from a store, but are an enhancement to it.

Modifying the transaction example, instead of

	store, err := cayley.NewMemoryGraph()
        ...
	t := cayley.NewTransaction()
	t.AddQuad(quad.Make("food", "is", "good", nil))
	err = store.ApplyTransaction(t)
        ...
	p = cayley.StartPath(store, quad.String("cats")).Out(quad.String("are"))
	err = p.Iterate(nil).EachValue(nil, func(v quad.Value) {
		fmt.Println("cats are", v.Native())
	})
        ...

worlds would have

	store, err := cayley.NewMemoryGraph()
        ...
	store := store.NewWorld()
	store.AddQuad(quad.Make("food", "is", "good", nil))
	p = cayley.StartPath(store, quad.String("cats")).Out(quad.String("are"))
	err = p.Iterate(nil).EachValue(nil, func(v quad.Value) {
		fmt.Println("cats are", v.Native())
	})
        ...
	store, err = store.Commit()
        ...