(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 ObjectsA 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
}
This is, perhaps, the greatest bug report of all time. IRC clients should specify a Gentoo-specific username: https://bugs.gentoo.org/35890
Just testing my new fancy twtwt client written in C
JMP: Newsletter: Multilingual Transcriptions and Better Voicemail Greetings
Hi everyone!
Welcome to the latest edition of your pseudo-monthly JMP update!
In case it’s been a while since you checked out JMP, here’s a refresher: JMP lets you send and receive text and picture messages (and calls) through a real phone number right from your computer, tablet, phone, or anything else that has a Jabber client. Among other things, JMP has these features: Your phone number on every device; Multiple phone numb … ⌘ Read more
trackbar.pl and nickcolor.pl as super-essentials. Also trying window_switcher.pl. Somehow my custom binds for Ctrl+1/2/3/etc. to switch to window 1/2/3/etc. doesn't do anything: { key = "^1"; id = "change_window"; data = "1"; } (I cannot use the default with Alt as this is handled by my window manager). Currently, I'm just cycling with Ctrl+N/P. Other things to solve in the near future:
@movq@www.uninformativ.de Oh, for some reason I always thought that WeeChat was a graphical client. I will try out WeeChat then, thanks for bringing it to my attention.
Erlang Solutions: Updates to the MIM Inbox in version 5.1
User interfaces in open protocolsWhen a messaging client starts, it typically presents the user with:
- an inbox
- a summary of chats (in chronological order)
- unread messages in their conversation
- a snippet of the most recent message in the conversation
- information on if a conversation is muted (and if so how long a conversation is muted for)
- other information that users may find useful on their welcome screen
Mongoos … ⌘ Read more
@prologic@twtxt.net: 1. I use classic twtxt client written in Python from console, I like simplicity; 2. Thanks for the feedback about my website! It’s better viewed with old 800x600 monitors, haha
Seems I forgot how to use my twtxt client
Ignite Realtime Blog: Push Notification Openfire plugin 0.9.1 released
The Ignite Realtime community is happy to announce the immediate availability of a bugfix release for the Push Notification plugin for Openfire!
This plugin adds support for sending push notifications to client software, as described in XEP-0357: “Push Notifications”.
[This update](https://www.igniterealtime.org/projects/openfire/plugins/0.9.1/pushnotificatio … ⌘ Read more
@movq@www.uninformativ.de @prologic@twtxt.net I just reread the spec and it seems to be even a bit outdated regarding machine-parsable conversation grouping. We long dropped the need to specify a whole hash tag with URL (#<hash url>), the simplified version without the URL (#hash) is enough.
The hash tag extension specification is kind of missing the same. However, I’m not sure if that short form is considered supported in general (as opposed to be a special case for subjects only) by the majority of the twtxt/yarn community.
Now the question arises, in order to keep things simple, should we even only allow the simplified twt hash tag for subjects and forbid the long version? This would also save quite a bit of space. The URL is probably not shown anyways in most clients. And if so, clients might rewrite URLs to their own instances. On the other hand, there’s technically nothing wrong with the long version in current parser implementations. And deprecating stuff without very good reason isn’t cool.
JMP: Newsletter: Command UI and Better Transcriptions Coming Soon
Hi everyone!
Welcome to the latest edition of your pseudo-monthly JMP update!
In case it’s been a while since you checked out JMP, here’s a refresher: JMP lets you send and receive text and picture messages (and calls) through a real phone number right from your computer, tablet, phone, or anything else that has a Jabber client. Among other things, JMP has these features: Your phone number on every device; Multiple phone numbers, one a … ⌘ Read more
JMP: Newsletter: Togethr, SMS-only Ports, Snikket Hosting
Hi everyone!
Welcome to the latest edition of your pseudo-monthly JMP update!
In case it’s been a while since you checked out JMP, here’s a refresher: JMP lets you send and receive text and picture messages (and calls) through a real phone number right from your computer, tablet, phone, or anything else that has a Jabber client. Among other things, JMP has these features: Your phone number on every device; Multiple phone numbers, one app; Free … ⌘ Read more
I realized my twtxt client isn’t validating what it pulls once it gets a valid response when a domain started returning js-heavy parking pages for every URL. Oops. Weekend project, I guess. 🤦🏻
O client do twtxt para o Emacs precisa de um upgrade.
JMP: Newsletter: New Staff, New Commands
Hi everyone!
Welcome to the latest edition of your pseudo-monthly JMP update!
In case it’s been a while since you checked out JMP, here’s a refresher: JMP lets you send and receive text and picture messages (and calls) through a real phone number right from your computer, tablet, phone, or anything else that has a Jabber client. Among other things, JMP has these features: Your phone number on every device; Multiple phone numbers, one app; Free as in Freedom; … ⌘ Read more
@prologic moving around servers, managed to break my twtxt client so using literally the first one I could find
Maxime Buquet: Updates from the Poezio ecosystem
Releases have happened recently that revolve around Poezio, a TUI
(Terminal UI) client for XMPP, including Poezio itself, its backend XMPP
library Slixmpp, and also the poezio and
slixmpp plugins for OMEMO.
 through a real phone number right from your computer, tablet, phone, or anything else that has a Jabber client. Among other things, JMP has these features: Your phone number on every device; Multiple phone numbers, one app; Free … ⌘ Read more
Monal IM: Insights into Monal Development
TLDR:
_Info: Monal will stop support for iOS 12, iOS 13 and macOS Catalina!
We are searching for a SwiftUI developer.
We need a new simplified website.
With better continuous funding, our push servers will move from the US to Europe.
We have a new support mail: info@monal-im.org_
Two years ago we decided to rewrite the Monal app almost entirely and improve it gradually in the process, instead of creating another XMPP Client for iOS and macOS. We suc … ⌘ Read more
JMP: Newsletter: JMP is 5 years old today, and now with international calls!
Hi everyone!
Welcome to the latest edition of your pseudo-monthly JMP update!
In case it’s been a while since you checked out JMP, here’s a refresher: JMP lets you send and receive text and picture messages (and calls) through a real phone number right from your computer, tablet, phone, or anything else that has a Jabber client. Among other things, JMP has these features: Your phone number on every device; Multiple phone … ⌘ Read more
Wallops 1.1 Released
A large update to my Wallops IRC client is available: ⌘ Read more
@benk@kwiecien.us I haven’t actually looked at the original twtxt client, which means the following is ill-conceived speculation, but I believe that it only fetched feeds when you “refreshed”, with a minimum time between feed fetches. Sure, you’ll fetch feed unnecessarily now and then, but not nearly as often as polling every 5 minutes ;)
Wallops 1.0 Released
As teased on Twitter, the first release of my Wallops IRC client is now available: ⌘ Read more
Profanity: Profanity on Pinephone
Hi all,
So far, in my pinephone I used mainly GUI applications, because I was using a touch screen. Terminal applications are not user-friendly when it comes to one-handed operation.
I tested different distributions on my pinephone (mobian, manjaro, archarm), but usually most based on Phosh. In my opinion it is currently the best mobile graphics environment and stable as well.
In Phosh I tested few xmpp clients:
- the default application installed with Phosh is chat … ⌘ Read more
Is the Web made for Computers? Or are Computers made for the Web?
A variation on the debate between Thick Clients and Thin Clients. ⌘ Read more
JMP: Newsletter: Snikket Hosting, Billing Overage Limits
Hi everyone!
Welcome to the latest edition of your pseudo-monthly JMP update!
In case it’s been a while since you checked out JMP, here’s a refresher: JMP lets you send and receive text and picture messages (and calls) through a real phone number right from your computer, tablet, phone, or anything else that has a Jabber client. Among other things, JMP has these features: Your phone number on every device; Multiple phone numbers, one app; Fr … ⌘ Read more
@benk@kwiecien.us I meant literally a few minutes 😄 @prologic@twtxt.net told me he’d just implemented it. Btw, which twtxt client are you using now, Ben?
stephaniewm55/1-Click-Torrent-Youtube-FFMPEG-Client
1 Click Torrent Youtube FFMPEG Client is torrent/Youtube downloader and FFMPEG video converter/player, built in Windows File Explorer, without settings and dependencies.
Language: C++
Star: 23
Watch: 23 ⌘ Read more
GoCN 每日新闻(2021-12-22)
GoCN 每日新闻(2021-12-22)- 使用 Go 和 SQLite 构建生产应用程序
- 使用 context.Context 模拟 API 客户端https://incident.io/blog/golang-client-mocks
- 一种可嵌入的 Go 脚本语言,实现了逻辑编程语言 Prologhttps://github.com/ichiban/prolog
- SSA:终于知道编译器偷摸做了哪些事[https://mp.weixin.qq.com/s/nOhMsMeP1pUFEXKAMUzbWg](https://mp.weixin.qq.com/ … ⌘ Read more
[vlog] [2021-12-08] pikⒶbu project concepts and direction
an information-centric client for misskey, email+autocrypt, and beyond. maybe a communist hive mind hiding in plain sight. you’ll never know!
https://codeberg.org/xjix/pikabu
https://pikabu.moe/ ⌘ Read more
Ignite Realtime Blog: inVerse plugin for Openfire version 9.0.0.1 released!
The Ignite Realtime community is happy to announce the immediate availability of a an update to the inVerse plugin for Openfire, which makes the Converse.js web client available to your users.
This release updates Converse to version 9.0.0.
Your Openfire instance should automatically display the … ⌘ Read more
DESQview/X : The forgotten mid-1990s OS from the future
X11 client and server. DOS. Windows 3.1. All with preemptive multitasking. ⌘ Read more
x86chi/twitter-github-contribution-graph
A client uploading Github contribution graph to Twitter profile banner
Language: HTML
Star: 4
Watch: 4 ⌘ Read more
yogain123/twitter-client
Twitter find Mutual Friends: Client
Language: JavaScript
Star: 3
Watch: 3 ⌘ Read more
@quark@ferengi.one No client, those were created using date -Is and emacs. Off course all is UTF-8 encoded, but now Apache also announces content-type: text/plain; charset=utf-8
JMP: Newsletter: Action required for SIP accounts, new inbound call features, and more!
Hi everyone!
Welcome to the latest edition of your pseudo-monthly https://jmp.chat update!
In case it’s been a while since you checked out JMP, here’s a refresher: JMP lets you send and receive text and picture messages (and calls) through a real phone number right from your computer, tablet, phone, or anything else that has a Jabber client. Among other things, JMP has these features: Your phone num … ⌘ Read more
@stackeffect@twtxt.stackeffect.de
I am seeing this characters on your twts: )?â\200¨â\200¨. Which client are you using?
@stigatle@twtxt.net
A twtxt client would be nice! Or a very simple cgi script to print twts to web nicely—not a second Yarn, just something to show twts in a pretty form on the web.
@eldersnake@yarn.andrewjvpowell.com
RSS links are archaic. Clients discover them if properly linked, they do not need to be human visible.
hurrah! xrxs client works~ there is a new blog post about all things xrxs
I am noticing that Yarn doesn’t treat “outside” (that is, twts coming from a client other than Yarn) twts hashes right. Two examples:
There are many more, but those two will give you the gist. Yarn links the hash to the poster’s twtxt.txt, so conversation matching will not work.
@lyse@lyse.isobeef.org Unless you are stripping stuff on your twts, there is no much to implement. Things will be bold , italics , underlined , and so on, on a client that can render them. Since jenny uses Mutt, I can use my own regex in it to color them as I like. That’s pretty much it.
GitHub security update: revoking weakly-generated SSH keys
On September 28, 2021, we received notice from the developer Axosoft regarding a vulnerability in a dependency of their popular git GUI client - GitKraken. An underlying issue with a dependency, called `keypair`, resulted in the GitKraken client generating weak SSH keys. ⌘ Read more
Taming gos memory usage or how we avoided rewriting our client in rust
1 points posted by kenny ⌘ Read more
@benk@kwiecien.us I’ve logged in to Monad now (iOS XMPP client) but I’ve gotta be honest: I don’t know if I’ve created a user in the app or logged in to tilde.team 🤔 Do you happen to know how I join a group? And which groups do you recommend?
JMP: Newsletter: Blog, New Registration, New Billing, New App!
Hi everyone!
Welcome to the latest edition of your pseudo-monthly JMP update!
In case it’s been a while since you checked out JMP, here’s a refresher: JMP lets you send and receive text and picture messages (and calls) through a real phone number right from your computer, tablet, phone, or anything else that has a Jabber client. Among other things, JMP has these features: Your phone number on every device; Multiple phone numbers … ⌘ Read more
Ignite Realtime Blog: JSXC Openfire plugin 4.3.1-1 released!
The Ignite Realtime community is happy to announce the immediate availability of version 4.3.1 release 1 of the JSXC plugin for Openfire, our open source real time collaboration server solution! This plugin can be used to conveniently make available the web-based JSXC client (a third-party developed project) to users of Openfire.
The upgrade from 4.3.0 to 4.3.1 brings a small number of changes from the JSXC project whi … ⌘ Read more
Exploring spartan (spartan.mozz.us)! Also trying to make simple client on netcat