Need little help please

3 views
Skip to first unread message

Afan Olovcic

unread,
Mar 15, 2011, 8:47:09 AM3/15/11
to pys...@googlegroups.com
Hi Guys,

Which is the best solution for my situation :

I have client server app and there is a messaging across Network
between them . But in same time I need messaging Locally for server
logic , and client logic too .What is the best way to do that ?

Thanks for great peace of software :)

John Yang

unread,
Mar 15, 2011, 12:34:37 PM3/15/11
to pys...@googlegroups.com
Hi Afan:

You can use local, group or network messaging at the same time. In
the main loop (manager.tick), it will attempt to process all three
types of messages. It should just work.

The best way for me to help is if you can provide a minimal sample of
code to illustrate what you need and I can share with you what I think
is the best way to approach it.

John

> --
> You received this message because you are subscribed to the Google Groups
> "pysage" group.
> To post to this group, send email to pys...@googlegroups.com.
> To unsubscribe from this group, send email to
> pysage+un...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/pysage?hl=en.
>

Afke

unread,
Mar 15, 2011, 7:08:36 PM3/15/11
to pysage
Hi John,

What I did not understand is how it works together ,for example :
(I will use example from SVN pysage-1.5.3\source\example\cluster
\server.py and client.py )

something like server.py extend with >>Messaging Locally Introduction
example << from documentation
if I understand that everything else will be ease to get :)

Ok ,we have

mgr = ActorManager.get_singleton()
...
...
if __name__ == '__main__':
mgr.listen('localhost', 8000, transport.SelectUDPTransport)
mgr.register_actor(TestMessageReceiver())

#and code from Introduction example
mgr.register_actor(Player(), 'player1')


while True:
mgr.queue_message(BombMessage(damage=10))
time.sleep(.50)
mgr.tick()

------------------------------------------------------------------------------------------

Afke

unread,
Mar 15, 2011, 6:20:42 PM3/15/11
to pysage
Hi John,

Thanks for your help I will make little example of what I need and
share it with you

Afan

On Mar 15, 5:34 pm, John Yang <bigjh...@gmail.com> wrote:

Afke

unread,
Mar 15, 2011, 7:43:07 PM3/15/11
to pysage
I solve problem :)

I forgot to set _SYNC_PRIORITY for classes and i get an error

just who has bigger priority bigger number or smaller number.

I will make some good example to share with community for this
situation.

Thanks for your time

Afan

On Mar 15, 5:34 pm, John Yang <bigjh...@gmail.com> wrote:

John Yang

unread,
Mar 15, 2011, 7:45:36 PM3/15/11
to pys...@googlegroups.com
Afan:

I believe you are referring to this example:

http://code.google.com/p/pysage/source/browse/trunk/example/cluster/server.py

when you did this:

mgr.queue_message(BombMessage(damage=10))

The "BombMessage" message will be sent locally, but you'll need an
actor that is subscribed to that message.

Now I see your email that you've solved your problem :)

John

Reply all
Reply to author
Forward
0 new messages