Skip to content

Batch mode implentations #2

@g302ge

Description

@g302ge

Motivation

Well, FS ESL protocol format is looked like below

command args \n\n
sendmsg [uuid]\n
call-command: execute \n
execute-app-name: answer \n
execute-app-arg: ,,, \n

If sending is ordered so the replies is ordered

so we could use the batch mode like LevelDB BatchWrite to batch multi commands and execute in on send and wait multi replies

Design

type BatchCommand struct {
}

and usage is

batch := &BatchCommand{}
batch
      .Connect()
      .Answer()
     .Api("originate", "user/1000@default &echo()", "")
     .Api("Other api execute")
     .execute() // sync wait replies

connectResponse, err := batch.Reply.Next()
answerResponse , err:= batch.Reply.Next()
originateRspons, err:= batch.Reply.Next()
// and so on

This design is very usefule when you call getvar or setvar :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions