Skip to content

Latest commit

 

History

7 提交

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

仓库 files navigation

Actor Model

This is a suggested implementation of Actor Model.

Actor Model Map

for Swift 4.0+

Terminology

  • Service respons to a range of requests. There are several kinds of Services:
kind of Service function must be obtainable synchronously preferred semantic
Server does real work of providing responses on requests NO reference type, class
Client delivers requests to remote server NO reference type, class
Proxy multiplex service methods to ServiceRequest YES value type, struct
  • ServicesFactory is a way of obtaining a service instance.

Service Usage

let servicesFactory = /* obtain `ServicesFactory` */

// obtain service syncronously
let peopleService = servicesFactory.peopleService(environment: .production)

// use service asyncronously
peopleService.person(name: "John Appleseed").onSuccess {
	print("There is a person \($0)")
}

How to run

  1. clone
  2. cd <dir_of_cloned_repo>
  3. swift run

关于

Suggested implementation of Actor Model

Resources

Stars

0 stars

关注者

1 watching

复刻s

发布

贡献者

Languages