Code Monkey home page Code Monkey logo

actor's Introduction

actor

            _             
           | |            
  __ _  ___| |_ ___  _ __ 
 / _` |/ __| __/ _ \| '__|
| (_| | (__| || (_) | |   
 \__,_|\___|\__\___/|_|   

Install

# install golang amd64 
open https://golang.org/dl/

# setup GOPATH env
export GOPATH=~/gopkg

# install actor package
go get github.com/nicholaskh/actor

# change dir to actor package
cd $GOPATH/src/github.com/nicholaskh/actor

# install all dependencies
go get ./... 

# build the executable
./build.sh

# create a custom config file based upon sample
cp etc/actord.cf.sample etc/actord.cf (change the address to your own)

# startup the daemon
./daemon/actord/actord

actor IS

  • external scheduler for delayed jobs

    • PvP march
    • PvE march
    • Job
  • serializer for concurrent updates

    • lock container/issuer with retry mechanism
    • actor make concurrent calls into sequential calls
  • coodinator

    • everything that may lead to race condition and concurrent updates will be decided by actor

TODO

  • worker php, retry only when errno=1(locked)
  • when faed restart, actor couldn't get lock any more. try restart fae, what actor happens?
  • what if beanstalk conn broken?
  • A encamp,然后1万人同时到,轮流打他,那么这个阶段,A啥也干不了。城外人的锁应该特殊处理
  • mysql ping within mysql max idle time, my.cf wait_timeout show variables like '%timeout%'
  • metrics of php request handling
  • test callback php timeout
  • test lock expiry
  • March may need K
  • alliance lock
  • pprof may influnce performance
  • mysql transaction with isolation repeatable read + optimistic locking has same effect
    • I'd rather kill actor instead of mysqld
    • what about distributed mysql instances?
  • teleport
  • Write/Read timeout and check N in loop
  • can a player send N marches to the same tile?
  • simulate mysql shutdown
    • done! golang mysql driver with breaker will handle this
  • WHERE UNIX_TIMESTAMP(time_end) index hit
    • need to optimize DB index
  • worker throttle
    • we can't have toooo many callbacks concurrently, use channel for throttle, easy...
  • handles NULL column
    • march.type done if it's NULL, what about others?
    • maybe we should let DB handle this
    • but mysql enum datatype can't handle this automatically
  • tsung 20M rows in db, and try actor

actor's People

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.