[Twisted-Python] Client Application service.Service

Tim Hughes thughes at thegoldfish.org
Wed Mar 16 18:24:14 MDT 2016


Woops : accidentally sent too early

Hi all,

I am looking into twisted for writing a client application (bot style) and
most of the examples I find are for server style applications.

Looking at the finger example and
https://github.com/jdavisp3/twisted-intro/blob/master/twisted-server-3/fastpoetry.py
I am just wondering where is best to put my application logic.

The protocol is basically a ascii line style application

It feels to me that my Service should be the main business logic  and the
protocol should just be a simple send/receive something like this gist

https://gist.github.com/timhughes/f85da0c2d88ecb4ab5e3#file-twisted_application_client-py-L36

I was then planning on writing web interface that interacted with the
service to send messages and display the response.

My main issue here is how to send the message from the service via the
protocol. I cannot find any good examples of this and am beginning to think
I am conceptualising incorrectly or over thinking it. If anyone can point
me to some examples or point me in the right direction it would be awesome.
Hopefully my example makes sense.

Cheers

Tim

Tim Hughes
mailto:thughes at thegoldfish.org

Hi all,

I am looking into twisted for writing a client application (bot style) and
most of the examples I find are for server style applications.



Looking at the finger example and
https://github.com/jdavisp3/twisted-intro/blob/master/twisted-server-3/fastpoetry.py
I am just wondering where is best to put my application logic.


The protocol is basically a ascii line style application


It feels to me that my Service should be the core and the protocol should
just be something like

def send_mesage(message):










Tim Hughes
mailto:thughes at thegoldfish.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/twisted-python/attachments/20160317/c6263a3a/attachment-0002.html>


More information about the Twisted-Python mailing list