You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Alexander Shigin (JIRA)" <ji...@apache.org> on 2008/07/03 22:15:45 UTC

[jira] Issue Comment Edited: (THRIFT-67) python non-blocking server

    [ https://issues.apache.org/jira/browse/THRIFT-67?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12610335#action_12610335 ] 

shigin edited comment on THRIFT-67 at 7/3/08 1:15 PM:
----------------------------------------------------------------

The Connection.read checks recieved length. And switch state to WAIT_PROCESS only if recieved len is exactly equal to first 4 bytes.

Here is a snippet
{code:python}
        elif self.status == WAIT_MESSAGE:
            read = self.socket.recv(self.len - len(self.message))
            if len(read) == 0:
                self.close()
                return
            self.message += read
            if len(self.message) == self.len:
                self.status = WAIT_PROCESS
{code}

      was (Author: shigin):
    The Connection.read checks recieved length. And switch state to WAIT_PROCESS only if recieved len is exactly equal to first 4 bytes.

Here is a snippet
{
        elif self.status == WAIT_MESSAGE:
            read = self.socket.recv(self.len - len(self.message))
            if len(read) == 0:
                self.close()
                return
            self.message += read
            if len(self.message) == self.len:
                self.status = WAIT_PROCESS
}
  
> python non-blocking server
> --------------------------
>
>                 Key: THRIFT-67
>                 URL: https://issues.apache.org/jira/browse/THRIFT-67
>             Project: Thrift
>          Issue Type: New Feature
>          Components: Library (Python)
>            Reporter: Alexander Shigin
>         Attachments: thrift-python-non-blocking.patch
>
>
> Implementation TNonblockingServer for python library.
> There is a couple of question to discuss:
>   * it has a slightly different interface for the rest of python servers. I think, it's okay: for example TransportFactory hasn't got any sense for non-blocking servers;
>   * it seems to have a huge ammount of bad grammar in doc strings;
>   * finally, I need a review.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.