是否可以在方法调用的函数内访问DDP连接?

时间:2016-02-29 17:40:41

标签: meteor

Meteor.methods
  foo: ->
    // this.connection is the DDP connection
    SomePackage.bar()

我希望能够访问我的包connection函数中的bar,而不会让调用者(我的包的用户)将连接作为参数传递。

1 个答案:

答案 0 :(得分:0)

是://Define the first @StringDef interface @StringDef({X_COLOR , O_COLOR}) @Retention(RetentionPolicy.SOURCE) public @interface ColorPreference{} public static final String X_COLOR = "x_color"; public static final String O_COLOR = "O_color"; //Define the second @StringDef interface @StringDef({PLAYER_X , PLAYER_Y}) @Retention(RetentionPolicy.SOURCE) public @interface PlayerPreferences{}; public static final String PLAYER_X = "player_x"; public static final String PLAYER_Y = "player_y";

相关:https://github.com/meteor/meteor/issues/6369