Processing objects using Ma Client Server
Chris Muller
asqueaker at gmail.com
Thu Apr 27 04:58:12 UTC 2017
Hi Hari,
forking from your process block is not normal usage..
> What I'd like to do is:
>
>
> myServer
>
> processOn: 12345
>
> using:
>
> [ :requestObject |
>
> [requestObject is MemberOf:A] ifTrue:[(requestObject instVarL)='somevalue' ifTrue:[ ResponseObject1 instVarA:( (requestObject instVarL) ) ].]
>
> [requestObject is MemberOf:B] ifTrue:[(requestObject instVarT)='somevalue' ifTrue:[ ResponseObject2 doSomething:(requestObject)].]
>
>
> ]
>
> I'd like to get a response without forking....
The request-handling block above, needs to evaluate to the response
object, but the block above is written as:
condition1 ifTrue: [ create1 ].
condition2 ifTrue: [ create2 ]
create1 will *never* be returned. It'll just create it and then move
on to test condition2. Every time its false, it'll answer nil, which
is why your client doesn't get a response; because
returning nil is a way to have a request-only type of request (no response).
You can't use return carats, so you need to structure it as a single
expression like this:
condition1
ifTrue: [ create1 ]
ifFalse:
[ condition2
ifTrue: [ create2 ]
ifFalse: [ InvalidRequest signal ] ]
Best,
Chris
> so that the responseObject is based on the conditionality and the value of one of its instance variables is based on some processing of an instance variable of the requestObject.
>
>
> Is there something structurally wrong with what I am trying to do, i.e. introduce conditionality within the processOn method?
>
>
> Kind regards,
>
>
> Hari
> _______________________________________________
> Magma mailing list
> Magma at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/mailman/listinfo/magma
More information about the Magma
mailing list