Searching txt.sour.is

Twts matching #reading
Sort by: Newest, Oldest, Most Relevant

I was just about to write a long response to a discussion I saw online. But while writing it, I realized that I have an opinion, but I can’t express it properly and somehow I don’t have anything to contribute. So I deleted my draft. I don’t have to give my two cents on everything. 😅 ⌘ Read more

⤋ Read More
In-reply-to » Progress! so i have moved into working on aggregates. Which are a grouping of events that replayed on an object set the current state of the object. I came up with this little bit of generic wonder.

(cont.)

Just to give some context on some of the components around the code structure.. I wrote this up around an earlier version of aggregate code. This generic bit simplifies things by removing the need of the Crud functions for each aggregate.

Domain Objects

A domain object can be used as an aggregate by adding the event.AggregateRoot struct and finish implementing event.Aggregate. The AggregateRoot implements logic for adding events after they are either Raised by a command or Appended by the eventstore Load or service ApplyFn methods. It also tracks the uncommitted events that are saved using the eventstore Save method.

type User struct {
  Identity string ```json:"identity"`

  CreatedAt time.Time

  event.AggregateRoot
}

// StreamID for the aggregate when stored or loaded from ES.
func (a *User) StreamID() string {
	return "user-" + a.Identity
}
// ApplyEvent to the aggregate state.
func (a *User) ApplyEvent(lis ...event.Event) {
	for _, e := range lis {
		switch e := e.(type) {
		case *UserCreated:
			a.Identity = e.Identity
			a.CreatedAt = e.EventMeta().CreatedDate
        /* ... */
		}
	}
}
Events

Events are applied to the aggregate. They are defined by adding the event.Meta and implementing the getter/setters for event.Event

type UserCreated struct {
	eventMeta event.Meta

	Identity string
}

func (c *UserCreated) EventMeta() (m event.Meta) {
	if c != nil {
		m = c.eventMeta
	}
	return m
}
func (c *UserCreated) SetEventMeta(m event.Meta) {
	if c != nil {
		c.eventMeta = m
	}
}
Reading Events from EventStore

With a domain object that implements the event.Aggregate the event store client can load events and apply them using the Load(ctx, agg) method.

// GetUser populates an user from event store.
func (rw *User) GetUser(ctx context.Context, userID string) (*domain.User, error) {
	user := &domain.User{Identity: userID}

	err := rw.es.Load(ctx, user)
	if err != nil {
		if err != nil {
			if errors.Is(err, eventstore.ErrStreamNotFound) {
				return user, ErrNotFound
			}
			return user, err
		}
		return nil, err
	}
	return user, err
}
OnX Commands

An OnX command will validate the state of the domain object can have the command performed on it. If it can be applied it raises the event using event.Raise() Otherwise it returns an error.

// OnCreate raises an UserCreated event to create the user.
// Note: The handler will check that the user does not already exsist.
func (a *User) OnCreate(identity string) error {
    event.Raise(a, &UserCreated{Identity: identity})
    return nil
}

// OnScored will attempt to score a task.
// If the task is not in a Created state it will fail.
func (a *Task) OnScored(taskID string, score int64, attributes Attributes) error {
	if a.State != TaskStateCreated {
		return fmt.Errorf("task expected created, got %s", a.State)
	}
	event.Raise(a, &TaskScored{TaskID: taskID, Attributes: attributes, Score: score})
	return nil
}
Crud Operations for OnX Commands

The following functions in the aggregate service can be used to perform creation and updating of aggregates. The Update function will ensure the aggregate exists, where the Create is intended for non-existent aggregates. These can probably be combined into one function.

// Create is used when the stream does not yet exist.
func (rw *User) Create(
  ctx context.Context,
  identity string,
  fn func(*domain.User) error,
) (*domain.User, error) {
	session, err := rw.GetUser(ctx, identity)
	if err != nil && !errors.Is(err, ErrNotFound) {
		return nil, err
	}

	if err = fn(session); err != nil {
		return nil, err
	}

	_, err = rw.es.Save(ctx, session)

	return session, err
}

// Update is used when the stream already exists.
func (rw *User) Update(
  ctx context.Context,
  identity string,
  fn func(*domain.User) error,
) (*domain.User, error) {
	session, err := rw.GetUser(ctx, identity)
	if err != nil {
		return nil, err
	}

	if err = fn(session); err != nil {
		return nil, err
	}

	_, err = rw.es.Save(ctx, session)
	return session, err
}

⤋ Read More
In-reply-to » Progress! so i have moved into working on aggregates. Which are a grouping of events that replayed on an object set the current state of the object. I came up with this little bit of generic wonder.

(cont.)

Just to give some context on some of the components around the code structure.. I wrote this up around an earlier version of aggregate code. This generic bit simplifies things by removing the need of the Crud functions for each aggregate.

Domain Objects

A domain object can be used as an aggregate by adding the event.AggregateRoot struct and finish implementing event.Aggregate. The AggregateRoot implements logic for adding events after they are either Raised by a command or Appended by the eventstore Load or service ApplyFn methods. It also tracks the uncommitted events that are saved using the eventstore Save method.

type User struct {
  Identity string ```json:"identity"`

  CreatedAt time.Time

  event.AggregateRoot
}

// StreamID for the aggregate when stored or loaded from ES.
func (a *User) StreamID() string {
	return "user-" + a.Identity
}
// ApplyEvent to the aggregate state.
func (a *User) ApplyEvent(lis ...event.Event) {
	for _, e := range lis {
		switch e := e.(type) {
		case *UserCreated:
			a.Identity = e.Identity
			a.CreatedAt = e.EventMeta().CreatedDate
        /* ... */
		}
	}
}
Events

Events are applied to the aggregate. They are defined by adding the event.Meta and implementing the getter/setters for event.Event

type UserCreated struct {
	eventMeta event.Meta

	Identity string
}

func (c *UserCreated) EventMeta() (m event.Meta) {
	if c != nil {
		m = c.eventMeta
	}
	return m
}
func (c *UserCreated) SetEventMeta(m event.Meta) {
	if c != nil {
		c.eventMeta = m
	}
}
Reading Events from EventStore

With a domain object that implements the event.Aggregate the event store client can load events and apply them using the Load(ctx, agg) method.

// GetUser populates an user from event store.
func (rw *User) GetUser(ctx context.Context, userID string) (*domain.User, error) {
	user := &domain.User{Identity: userID}

	err := rw.es.Load(ctx, user)
	if err != nil {
		if err != nil {
			if errors.Is(err, eventstore.ErrStreamNotFound) {
				return user, ErrNotFound
			}
			return user, err
		}
		return nil, err
	}
	return user, err
}
OnX Commands

An OnX command will validate the state of the domain object can have the command performed on it. If it can be applied it raises the event using event.Raise() Otherwise it returns an error.

// OnCreate raises an UserCreated event to create the user.
// Note: The handler will check that the user does not already exsist.
func (a *User) OnCreate(identity string) error {
    event.Raise(a, &UserCreated{Identity: identity})
    return nil
}

// OnScored will attempt to score a task.
// If the task is not in a Created state it will fail.
func (a *Task) OnScored(taskID string, score int64, attributes Attributes) error {
	if a.State != TaskStateCreated {
		return fmt.Errorf("task expected created, got %s", a.State)
	}
	event.Raise(a, &TaskScored{TaskID: taskID, Attributes: attributes, Score: score})
	return nil
}
Crud Operations for OnX Commands

The following functions in the aggregate service can be used to perform creation and updating of aggregates. The Update function will ensure the aggregate exists, where the Create is intended for non-existent aggregates. These can probably be combined into one function.

// Create is used when the stream does not yet exist.
func (rw *User) Create(
  ctx context.Context,
  identity string,
  fn func(*domain.User) error,
) (*domain.User, error) {
	session, err := rw.GetUser(ctx, identity)
	if err != nil && !errors.Is(err, ErrNotFound) {
		return nil, err
	}

	if err = fn(session); err != nil {
		return nil, err
	}

	_, err = rw.es.Save(ctx, session)

	return session, err
}

// Update is used when the stream already exists.
func (rw *User) Update(
  ctx context.Context,
  identity string,
  fn func(*domain.User) error,
) (*domain.User, error) {
	session, err := rw.GetUser(ctx, identity)
	if err != nil {
		return nil, err
	}

	if err = fn(session); err != nil {
		return nil, err
	}

	_, err = rw.es.Save(ctx, session)
	return session, err
}

⤋ Read More

RT by @mind_booster: As declarações do Chanceler Alemão Olaf Scholz deram ânimo às intenções dos governos de Portugal e Espanha para uma eventual expansão da rede de gás natural fóssil podendo colocar em causa os objetivos europeus de combate às alterações climáticas. https://zero.ong/zero-tem-enormes-duvidas-sobre-expansao-e-interconexao-iberica-da-rede-de-gas/
As declarações do Chanceler Alemão Olaf Scholz deram ânimo às intenções dos governos de Portugal e Espanha para uma eventual expansão da rede de gás na … ⌘ Read more

⤋ Read More

The XMPP Standards Foundation: Mid Term Evaluation Updates
It’s been a month since I wrote my last blog. For those of you who have been following my blogs, thanks a lot for taking the time to read them. In this blog, I will give the updates post mid-term evaluation and the challenges that I have been facing and how I overcame some of them.

The Mid-Term Evaluation

For those of you who don’t know much about GSoC, a mid-term evaluat … ⌘ Read more

⤋ Read More

**RT by @mind_booster: [¼]
Terminou ontem a consulta pública do projeto Aproveitamento Hidráulico de Fins Múltiplos do Crato (Barragem do Crato) a que a ZERO dá parecer negativo

❌Dinheiro do PRR vai ser usado p/ projeto sem sentido e promotor de impactes ambientais e sociais negativos

👇(continua)**
[¼]

Terminou ontem a consulta pública do projeto Aproveitamento Hidráulico de Fins Múltiplos do Crato (Barragem do Crato) a que a ZERO dá parecer negativo

❌Dinheiro do PRR vai ser usado p/ projeto sem sentido e p … ⌘ Read more

⤋ Read More

RT by @mind_booster: Two related stories this month show capitalism’s incompatibility with human and non-human flourishing. First, a study found all rainwater on earth is unsafe to drink because it’s contaminated with the ‘forever chemicals’ Per- and poly-fluoroalkyl (PFAS). 🧵https://www.euronews.com/green/2022/08/04/rainwater-everywhere-on-earth-unsafe-to-drink-due-to-forever-chemicals-study-finds
Two related stories this month show capitalism’s incompatibility with human and non-human flourishing. First, a st … ⌘ Read more

⤋ Read More

RT by @mind_booster: Amanhã no HopSin Brewpub em Colares entre as 18h30 e as 19h30 apareçam para ajudar a traduzir o Nextcloud @Nextclouders Também se podem juntar online. Vejam aqui como: https://ansol.org/eventos/2022-08-11-traducoes-nextcloud/
Amanhã no HopSin Brewpub em Colares entre as 18h30 e as 19h30 apareçam para ajudar a traduzir o Nextcloud @Nextclouders Também se podem juntar online. Vejam aqui como: [ansol.org/eventos/2022-08-11…](https://ansol.org/ev … ⌘ Read more

⤋ Read More

RT by @mind_booster: A complacência com que tratamos empresas monopolistas deixa-me sem palavras para qualificar estas práticas. Isto viola quase todas as regras de concorrência e boas práticas de mercado. href=”https://txt.sour.is/search?q=%23microsoft”>#microsoft**
A complacência com que tratamos empresas monopolistas deixa-me sem palavras para qualificar estas práticas. Isto viola quase todas as regras de concorrência e boas práticas de mercado. #microsoft

![](https://nitter.net/pic/media%2FFZzK-pbXoAEoeJp. … ⌘ Read more

⤋ Read More

Dependabot now alerts for vulnerable GitHub Actions
GitHub Actions gives teams access to powerful, native CI/CD capabilities right next to their code hosted in GitHub. Starting today, GitHub will send a Dependabot alert for vulnerable GitHub Actions, making it even easier to stay up to date and fix security vulnerabilities in your actions workflows. ⌘ Read more

⤋ Read More

New request for comments on improving npm security with Sigstore is now open
Supply chain attacks exploit our implicit trust of open source to hurt developers and our customers. Read our proposal for how npm will significantly reduce supply chain attacks by signing packages with Sigstore. ⌘ Read more

⤋ Read More

All GitHub Enterprise users now have access to the security overview
Today, we’re expanding access to the GitHub security overview! All GitHub Enterprise customers now have access to the security overview, not just those with GitHub Advanced Security. Additionally, all users within an enterprise can now access the security overview, not just admins and security managers. ⌘ Read more

⤋ Read More

I started working on plugins for GoBlog using a Go module I recently discovered: yaegi. It still feels like magic, because Go is typically a compiled language and yaegi makes it dynamic by embedding an interpreter. Is this overkill for GoBlog or does this possibly enable flexibility like WordPress plugins? ⌘ Read more

⤋ Read More

Dino: Stateless File Sharing: Base implementation
The last few weeks were quite busy for me, but there was also a lot of progress.
I’m happy to say that the base of stateless file sharing is implemented and working.
Let’s explore some of the more interesting topics.

File Hashes

File hashes have some practical applications, such as file validation and duplication detection.
As such, they are part of the [metadata element](https://xmpp.org/extensio … ⌘ Read more

⤋ Read More

Release Radar · July 2022 Edition
While some of us have been wrapping up the financial year, and enjoying vacation time, others have been hard at work shipping open source projects and releases. These projects include everything from world-changing technology to developer tooling, and weekend hobbies. Here are some of the open source projects that released major version updates this July. […] ⌘ Read more

⤋ Read More

**RT by @mind_booster: [¼]
✈️Novo passo na expansão ilegal do Aeroporto da Portela prejudicará severamente milhares de cidadãos.

⚠️Foi iniciado processo de consulta pública sobre portaria que passará a permitir voos noturnos sem limites.

(Continua 👇)**
[¼]

✈️Novo passo na expansão ilegal do Aeroporto da Portela prejudicará severamente milhares de cidadãos.

⚠️Foi iniciado processo de consulta pública sobre portaria que passará a permitir voos noturnos sem limites.

(Continua 👇)

![](https://nitter.net/pic/me … ⌘ Read more

⤋ Read More

Hi, I am playing with making an event sourcing database. Its super alpha but I thought I would share since others are talking about databases and such.

It’s super basic. Using tidwall/wal as the disk backing. The first use case I am playing with is an implementation of msgbus. I can post events to it and read them back in reverse order.

I plan to expand it to handle other event sourcing type things like aggregates and projections.

Find it here: sour-is/ev

@prologic@twtxt.net @movq@www.uninformativ.de @lyse@lyse.isobeef.org

⤋ Read More

Hi, I am playing with making an event sourcing database. Its super alpha but I thought I would share since others are talking about databases and such.

It’s super basic. Using tidwall/wal as the disk backing. The first use case I am playing with is an implementation of msgbus. I can post events to it and read them back in reverse order.

I plan to expand it to handle other event sourcing type things like aggregates and projections.

Find it here: sour-is/ev

@prologic@twtxt.net @movq@www.uninformativ.de @lyse@lyse.isobeef.org

⤋ Read More

RT by @mind_booster: Importante ler⬇️
Cada vez mais, qualquer pessoa ou entidade pode fazer o que quiser neste país, sem regra, nem lei. E os vizinhos que se lixem. O ruído (incluindo actividades de entretenimento) mata a criatividade e dá cabo da saúde, mas ninguém quer saber.

Importante ler⬇️

Cada vez mais, qualquer pessoa ou entidade pode fazer o que quiser neste país, sem regra, nem lei. E os vizinhos que se lixem. O ruído (incluindo actividades de entretenimento) mata a criatividade e dá cabo da saúde, … ⌘ Read more

⤋ Read More

R to @mind_booster: “A par disto, quer ainda retirar quaisquer restrições ao tráfego aéreo noturno em Lisboa, quando os níveis de ruído já excedem imenso, como a ZERO recentemente demonstrou, os valores legais que procuram salvaguardar a saúde pública.” 6/7
“A par disto, quer ainda retirar quaisquer restrições ao tráfego aéreo noturno em Lisboa, quando os níveis de ruído já excedem imenso, como a ZERO recentemente demonstrou, os valores legais que procuram salvaguardar a saúde pública.” 6/7 ⌘ Read more

⤋ Read More

R to @mind_booster: “retirar a avaliação dos processos de loteamento e a redução dos prazos para emissão de pareceres e licenças, licenças ambientais validadas automaticamente (atualmente as licenças ambientais têm a validade de 10 anos).” 5/7
“retirar a avaliação dos processos de loteamento e a redução dos prazos para emissão de pareceres e licenças, licenças ambientais validadas automaticamente (atualmente as licenças ambientais têm a validade de 10 anos).” 5/7 ⌘ Read more

⤋ Read More

R to @mind_booster: “O estímulo ao deferimento tácito para facilitar ao máximo a aprovação de qualquer projeto, em que o foco é mesmo aprovar, seja o que for, de qualquer forma e seja onde for;” 4/7
“O estímulo ao deferimento tácito para facilitar ao máximo a aprovação de qualquer projeto, em que o foco é mesmo aprovar, seja o que for, de qualquer forma e seja onde for;” 4/7 ⌘ Read more

⤋ Read More

R to @mind_booster: “Desinvestiu, deixou que os procedimentos se burocratizassem para depois ter argumentos de desvalorização deste instrumento, ao contrário de o credibilizar, valorizar e modernizar.” 3/7
“Desinvestiu, deixou que os procedimentos se burocratizassem para depois ter argumentos de desvalorização deste instrumento, ao contrário de o credibilizar, valorizar e modernizar.” 3/7 ⌘ Read more

⤋ Read More

“Com a apresentação do Simplex na área ambiental, o Governo prepara-se para retroceder décadas na política ambiental, fazendo tábua rasa dos valores fundamentais que a política ambiental e o instrumento da avaliação de impacte ambiental visam proteger.” 1/7
“Com a apresentação do Simplex na área ambiental, o Governo prepara-se para retroceder décadas na política ambiental, fazendo tábua rasa dos valores fundamentais que a política ambiental e o instrumento da avaliação de impacte ambiental visam proteger.” … ⌘ Read more

⤋ Read More

R to @mind_booster: “O Governo está a fazer com a avaliação ambiental, aquilo que fez com a conservação da natureza e a proteção da biodiversidade.” 2/7
“O Governo está a fazer com a avaliação ambiental, aquilo que fez com a conservação da natureza e a proteção da biodiversidade.” 2/7 ⌘ Read more

⤋ Read More

5 simple things you can do with GitHub Packages to level up your workflows
From hosting private packages in a private repository to tightening your security profile with GITHUB_TOKEN, here are five simple ways you can streamline your workflow with GitHub Packages. ⌘ Read more

⤋ Read More

Ignite Realtime Blog: REST API Openfire plugin 1.9.0 released!
We have released version 1.9.0 of the Openfire REST API plugin! This version adds functionality and provides some bug fixes that relates to multi-user chat rooms.

The updated plugin should become available for download in your Openfire admin console in the course of the next few hours. Alternatively, you can download the plugin directly, from [the plugin’s archive page](https://www.igniterealtime.org/projects/openfire/pl … ⌘ Read more

⤋ Read More

The XMPP Standards Foundation: The XMPP Newsletter July 2022
Welcome to the XMPP Newsletter, great to have you here again! This issue covers the month of July 2022.

Like this newsletter, many projects and their efforts in the XMPP community are a result of people’s voluntary work. If you are happy with the services and software you may be using, especially throughout the current situation, please consider saying thanks or help these projects! Interested in supporting the Newsletter team? Read more at the bottom … ⌘ Read more

⤋ Read More

**R to @mind_booster: Metaverse? Yeah, that other new thing, haven’t you notice? Nevermind that book in my shelf claiming that Second Life is Linden Lab’s Metaverse, or years of Metaverse references older than Facebook in papers, conferences, etc.: the Metaverse is now.

https://www.wiley.com/en-us/Second+Life%3A+The+Official+Guide-p-9780470096086**
Metaverse? Yeah, that other new thing, haven’t you notice? Nevermind that book in my shelf claiming that Second Life is Linden Lab’s Metaverse, or years of Metavers … ⌘ Read more

⤋ Read More

**R to @mind_booster: “Web 4.0? Ridiculous!”, some will say, buy that hasn’t stopped anyone from keeping the madness going. Hm, that’s right, nowadays web 5.0 is coined already too - it’s “The Telepathic Web” or “The Symbionet Web”, or, I’ll call it “the Metaverse brain chip”.

https://www.timesnownews.com/exclusive/jack-dorsey-web-5-0-how-will-it-work-and-why-it-is-different-article-92209954**
“Web 4.0? Ridiculous!”, some will say, buy that hasn’t stopped anyone from keeping the madness going. Hm, that’s right … ⌘ Read more

⤋ Read More

People now talk about “web3” as if it was a new thing, when in fact it has been being redefined, again and again, for years. Years, yes, and not just a few: just see what I wrote about this subject 15 years ago, when we were already debating web3… and 4:
https://mindboosternoori.blogspot.com/2007/08/what-is-web-30.html

People now talk about “web3” as if it was a new thing, when in fact it has been being redefined, again and again, for years. Years, yes, and not just a few: just see what I wrote about this … ⌘ Read more

⤋ Read More

R to @mind_booster: So? “Anything above 1.5C will see a world plagued by intense summer heat, extreme drought, devastating floods, reduced crop yields, rapidly melting ice sheets and surging sea levels. A rise of 2C and above will seriously threaten the stability of global society, McGuire argues.”
So? “Anything above 1.5C will see a world plagued by intense summer heat, extreme drought, devastating floods, reduced crop yields, rapidly melting ice sheets and surging sea levels. A rise of 2C and above will s … ⌘ Read more

⤋ Read More

“to limit that rise to 1.5C […] global carbon emissions will have to be reduced by 45% by 2030.
[…]
Instead, we are on course for close to a 14% rise in emissions by that date – which will almost certainly see us shatter the 1.5C guardrail in less than a decade.”

“to limit that rise to 1.5C […] global carbon emissions will have to be reduced by 45% by 2030.

[…]

Instead, we are on course for close to a 14% rise in emissions by that date – which will almost certainly see us shatter the 1.5C guardrai … ⌘ Read more

⤋ Read More