summaryrefslogtreecommitdiff
path: root/codegen.py
diff options
context:
space:
mode:
authorTony Garnock-Jones <tonyg@lshift.net>2009-09-18 13:05:47 +0100
committerTony Garnock-Jones <tonyg@lshift.net>2009-09-18 13:05:47 +0100
commita95080fdfe8a7d2fdbf25fba6654abc77fd1d2ba (patch)
tree5e17e538b258024f055002cc0761056bdd16882b /codegen.py
parent218f55288615945c9c3dcca7fb862b7b5e5ec2b2 (diff)
parent79b4481a858020c2486f5b561b63d427c61bcf35 (diff)
downloadrabbitmq-server-git-a95080fdfe8a7d2fdbf25fba6654abc77fd1d2ba.tar.gz
merge default into bug21346
Diffstat (limited to 'codegen.py')
-rw-r--r--codegen.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/codegen.py b/codegen.py
index 84741ea28d..533192c507 100644
--- a/codegen.py
+++ b/codegen.py
@@ -117,6 +117,13 @@ def genErl(spec):
def genMethodHasContent(m):
print "method_has_content(%s) -> %s;" % (m.erlangName(), str(m.hasContent).lower())
+
+ def genMethodIsSynchronous(m):
+ hasNoWait = "nowait" in fieldNameList(m.arguments)
+ if m.isSynchronous and hasNoWait:
+ print "is_method_synchronous(#%s{nowait = NoWait}) -> not(NoWait);" % (m.erlangName())
+ else:
+ print "is_method_synchronous(#%s{}) -> %s;" % (m.erlangName(), str(m.isSynchronous).lower())
def genMethodFieldTypes(m):
"""Not currently used - may be useful in future?"""
@@ -246,6 +253,7 @@ def genErl(spec):
-export([method_id/1]).
-export([method_has_content/1]).
+-export([is_method_synchronous/1]).
-export([method_fieldnames/1]).
-export([decode_method_fields/2]).
-export([decode_properties/2]).
@@ -266,6 +274,9 @@ bitvalue(undefined) -> 0.
for m in methods: genMethodHasContent(m)
print "method_has_content(Name) -> exit({unknown_method_name, Name})."
+ for m in methods: genMethodIsSynchronous(m)
+ print "is_method_synchronous(Name) -> exit({unknown_method_name, Name})."
+
for m in methods: genMethodFieldNames(m)
print "method_fieldnames(Name) -> exit({unknown_method_name, Name})."