request sequence numbers

Implementing a new protocol, I would like to give each request a unique sequence number. Experimenting with James Gregory’s sample Ping protocol, I tried adding a seqNr field to the request builder (PingUrlBuilder) and incrementing in the action builder’s withNext method:

class PingActionBuilder(requestName: String, requestBuilder: PingUrlBuilder, next: ActorRef) extends ActionBuilder {

def withNext(next: ActorRef) = new PingActionBuilder(requestName,

new PingUrlBuilder(requestBuilder.requestName, requestBuilder.dir, requestBuilder.seqNbr + 1),

next)

but that doesn’t work.

Any other suggestions?

thx,

Yo

Sorry, I’m not sure about what you’re trying to achieve.

Do you want to:

  • have a unique number per HTTP request,
  • or have a unique number per request typology (per exec(request…))?
    What you’ve developed so far is for the second possibility. And it doesn’t work because you’re not updating requestBuilder.seqNbr, so you’re always passing initialValue + 1

Any chance you publish your code on Github, so I can get a better understanding of what you’re doing?

Stéphane

Trying to write another protocol. The new protocol is unrelated to HTTP. The aim is to test performance of storage IO, e.g. File writes and reads.
I assumed that withNext was being called for each run through the scenario. I now understand that it is not.

Not ready for posting on GitHub yet.

Your reply was very helpful.

thx,

Yo

Beware that withNext no longer exists in 2.X.

==> ActionBuilder.build(next: ActorRef, protocolConfigurationRegistry: ProtocolConfigurationRegistry): ActorRef

ActionBuilder.build is called only once, when the worklow is being resolved, before throwing users/messages to it.