From: David Reiss Date: Tue, 24 Mar 2009 20:02:22 +0000 (+0000) Subject: THRIFT-136. s/async/oneway/ in the Thrift IDL X-Git-Tag: 0.2.0~224 X-Git-Url: https://source.supwisdom.com/gerrit/gitweb?a=commitdiff_plain;h=cecbed81c806e40ca0342d7b8e265d2bf55a2f04;p=common%2Fthrift.git THRIFT-136. s/async/oneway/ in the Thrift IDL This is the real change. The lexer now recognizes "oneway" and warns on "async". All example and test IDLs have been updated, as have the syntax files. git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@757994 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/compiler/cpp/src/thriftl.ll b/compiler/cpp/src/thriftl.ll index 60a7f2c7..9392734c 100644 --- a/compiler/cpp/src/thriftl.ll +++ b/compiler/cpp/src/thriftl.ll @@ -106,7 +106,7 @@ st_identifier ([a-zA-Z-][\.a-zA-Z_0-9-]*) "map" { return tok_map; } "list" { return tok_list; } "set" { return tok_set; } -"async" { return tok_oneway; } +"oneway" { return tok_oneway; } "typedef" { return tok_typedef; } "struct" { return tok_struct; } "exception" { return tok_xception; } @@ -117,6 +117,10 @@ st_identifier ([a-zA-Z-][\.a-zA-Z_0-9-]*) "const" { return tok_const; } "required" { return tok_required; } "optional" { return tok_optional; } +"async" { + pwarning(0, "\"async\" is deprecated. It is called \"oneway\" now.\n"); + return tok_oneway; +} "abstract" { thrift_reserved_keyword(yytext); } diff --git a/contrib/fb303/if/fb303.thrift b/contrib/fb303/if/fb303.thrift index fb9e220a..799d5f85 100644 --- a/contrib/fb303/if/fb303.thrift +++ b/contrib/fb303/if/fb303.thrift @@ -95,11 +95,11 @@ service FacebookService { /** * Tell the server to reload its configuration, reopen log files, etc */ - async void reinitialize(), + oneway void reinitialize(), /** * Suggest a shutdown to the server */ - async void shutdown(), + oneway void shutdown(), } diff --git a/contrib/thrift.el b/contrib/thrift.el index fdee7e28..7d1c7515 100644 --- a/contrib/thrift.el +++ b/contrib/thrift.el @@ -10,7 +10,7 @@ (defconst thrift-font-lock-keywords (list '("#.*$" . font-lock-comment-face) ;; perl style comments - '("\\<\\(include\\|struct\\|exception\\|typedef\\|const\\|enum\\|service\\|extends\\|void\\|async\\|throws\\|optional\\|required\\)\\>" . font-lock-keyword-face) ;; keywords + '("\\<\\(include\\|struct\\|exception\\|typedef\\|const\\|enum\\|service\\|extends\\|void\\|oneway\\|throws\\|optional\\|required\\)\\>" . font-lock-keyword-face) ;; keywords '("\\<\\(bool\\|byte\\|i16\\|i32\\|i64\\|double\\|string\\|binary\\|map\\|list\\|set\\)\\>" . font-lock-type-face) ;; built-in types '("\\<\\([0-9]+\\)\\>" . font-lock-variable-name-face) ;; ordinals '("\\<\\(\\w+\\)\\s-*(" (1 font-lock-function-name-face)) ;; functions diff --git a/contrib/thrift.vim b/contrib/thrift.vim index e8580c71..dd87eb3a 100644 --- a/contrib/thrift.vim +++ b/contrib/thrift.vim @@ -40,7 +40,7 @@ syn keyword thriftStructure map list set struct typedef exception enum throws syn match thriftSpecial "\d\+:" " Structure -syn keyword thriftStructure service async extends +syn keyword thriftStructure service oneway extends "async" { return tok_async; } "exception" { return tok_xception; } "extends" { return tok_extends; } diff --git a/lib/rb/spec/ThriftSpec.thrift b/lib/rb/spec/ThriftSpec.thrift index 51758a3e..045e5f59 100644 --- a/lib/rb/spec/ThriftSpec.thrift +++ b/lib/rb/spec/ThriftSpec.thrift @@ -40,7 +40,7 @@ exception Xception { service NonblockingService { Hello greeting(1:bool english) bool block() - async void unblock(1:i32 n) - async void shutdown() + oneway void unblock(1:i32 n) + oneway void shutdown() void sleep(1:double seconds) } diff --git a/test/ThriftTest.thrift b/test/ThriftTest.thrift index fe3eba16..7049d51c 100644 --- a/test/ThriftTest.thrift +++ b/test/ThriftTest.thrift @@ -103,7 +103,7 @@ service ThriftTest Xtruct testMultiException(string arg0, string arg1) throws(Xception err1, Xception2 err2) /* Test oneway void */ - async void testOneway(1:i32 secondsToSleep) + oneway void testOneway(1:i32 secondsToSleep) } service SecondService diff --git a/tutorial/tutorial.thrift b/tutorial/tutorial.thrift index 52e1b75b..b87988a0 100644 --- a/tutorial/tutorial.thrift +++ b/tutorial/tutorial.thrift @@ -121,7 +121,7 @@ service Calculator extends shared.SharedService { * a request and does not listen for any response at all. Oneway methods * must be void. */ - async void zip() + oneway void zip() }