You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Session() will be the main function, it can be related to a "user".
It will be called by volume func and will execute Execute() func for each request in a group.
type Session struct {
All returned variables from a request
Global variables ? like token
}
func (s *Session) Create( rg Requestgroup) (error)
Add possibility to use "context" to pass variables (like token , or dataset)
Edit by Anthony-Jhoiro 03/05/2020
Interfaces suggestions (explanations bellow) :
package session
typeContextinterface {
// ResolveVariable returns the value of a variable, if the variable does // not exists in the context, return an empty string and false or return // the value and trueResolveVariable(variableNamestring) (string, bool)
}
typeSessionExecutionTracestruct {}
typeSessioninterface {
// Get the context of the sessionGetContext() Context// Run executes each step of the sessionRun() (SessionExecutionTrace, error)
}
// ContextBuilder Help to build contexts in an abstract waytypeContextBuilderinterface {
// AddVariable adds a variable to the contextAddVariable(keystring, valuestring)
// ConcatContext adds the information of a context into the new contextConcatContext(ctxContext)
// Build Build the contextBuild() Context
}
It is important that the SessionContext should be immutable as a lot of async processes might use it and we do not want to avoid side effects.To pass variables between Session "steps" a new context should be created each time.
To make this operation easier, a ContextBuilder can be useful to group all of our methods and help provide immutable contexts.
It might be a good idea to split the session package into 2 smaller packages to handle the main session and the context separately but might be overkill.
The text was updated successfully, but these errors were encountered:
Session() will be the main function, it can be related to a "user".
It will be called by volume func and will execute Execute() func for each request in a group.
type Session struct {
All returned variables from a request
Global variables ? like token
}
func (s *Session) Create( rg Requestgroup) (error)
Add possibility to use "context" to pass variables (like token , or dataset)
Edit by Anthony-Jhoiro 03/05/2020
Interfaces suggestions (explanations bellow) :
It is important that the
SessionContext
should be immutable as a lot of async processes might use it and we do not want to avoid side effects.To pass variables between Session "steps" a new context should be created each time.To make this operation easier, a
ContextBuilder
can be useful to group all of our methods and help provide immutable contexts.It might be a good idea to split the session package into 2 smaller packages to handle the main session and the context separately but might be overkill.
The text was updated successfully, but these errors were encountered: