Wechaty Actor
Wechaty Actor Model, Powered by XState, Mailbox, and CQRS
Wechaty Actor is an wrapper for Wechaty that applies the Actor Model with XState and CQRS.
Actor Model
The Actor Model is a computational model for designing concurrent, distributed systems around the principal of self-contained Actors which operate on sending and receiving messages.
— Introduction to the Actor Model...
Features
- Working with wechaty-cqrs by receiving the CQRS Commands and Queries, and responding Responses.
- Implemented with XState and Mailbox
- Native designed for Domain Driven Design (DDD)
Usage
Install
npm install wechaty-actor wechaty-cqrs wechaty
Quick start
Here's the Actor version of the Wechaty bot usage:
import * as ACTOR from 'wechaty-actor'
import * as CQRS from 'wechaty-cqrs'
import * as WECHATY from 'wechaty'
const wechaty = WECHATY.WechatyBuilder.build()
await wechaty.init()
const bus$ = CQRS.from(wechaty)
const actor = ACTOR.from(bus$)
actor.send(CQRS.commands.StartCommand(wechaty.puppet.id))
Learn how to build a Ding Dong BOT with Actor from our examples/ding-dong-bot.ts
Getting Started
Here's a video introduction for CQRS Wechaty with live demo, presented by Huan:
To-be-recorded
The getting started ding-dong-bot.ts in the video: https://github.com/wechaty/getting-started/blob/main/examples/actor/ding-dong-bot.ts
API Reference
Read Wechaty Actor API Reference at: https://paka.dev/npm/wechaty-actor
Blogs
Resources
- The actor model in 10 minutes
- Node.js actor framework
- Beautiful State Machines - XState Catalogue is a collection of professionally designed state machines you can drop into your projects. Get started by browsing the catalogue, interacting with the machines, and copying the code.
- XState: Should this be an action or a service?
- Introduction to the Actor Model for Concurrent Computation, John Murray, Sep 29, 2015, Tech Talks @ AppNexus
- Kotlin Concurrency with Actors, Jag Saund, Jun 14, 2018
- Pure UI using Xstate and ReactJS
History
main
v0.0.1 (May 8, 2022)
- v0.0.1 (Mar 6, 2022): Init README & Draft design from bot5-assistant#1
Author
Huan LI is a serial entrepreneur, active angel investor with strong technology background. Huan is a widely recognized technical leader on conversational AI and open source cloud architectures. He co-authored guide books "Chatbot 0 to 1" and "Concise Handbook of TensorFlow 2" and has been recognized both by Microsoft and Google as MVP/GDE. Huan is a Chatbot Architect and speaks regularly at technical conferences around the world. Find out more about his work at https://github.com/huan
Copyright & License
- Code & Docs © 2022 Huan (李卓桓) <zixia@zixia.net>
- Code released under the Apache-2.0 License
- Docs released under Creative Commons