Пример #1
0
 def CreateUser(self, request, context):
     metadata = dict(context.invocation_metadata())
     print(metadata)
     user = users_messages.User(username=request.username, user_id=1)
     return users_messages.CreateUserResult(user=user)
Пример #2
0
 def CreateUser(self, request, context):
     user = users_messages.User(username=request.username, user_id=1)
     if random.random() > 0.5:
         1 / 0
     return users_messages.CreateUserResult(user=user)