Class: Iodine::PubSub::Subscription
- Inherits:
-
Object
- Object
- Iodine::PubSub::Subscription
- Defined in:
- ext/iodine/iodine_pubsub.c
Instance Method Summary collapse
-
#==(str) ⇒ Object
Test if the subscription’s target is equal to String.
-
#close ⇒ Object
Closes (cancels) a subscription.
-
#to_s ⇒ Object
Returns the target stream / channel / pattern as a String object.
Instance Method Details
#==(str) ⇒ Object
Test if the subscription’s target is equal to String.
235 236 237 |
# File 'ext/iodine/iodine_pubsub.c', line 235
static VALUE subscription_eq_s(VALUE self, VALUE str) {
return rb_str_equal(rb_attr_get(self, to_str_shadow_id), str);
}
|
#close ⇒ Object
Closes (cancels) a subscription.
215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 |
# File 'ext/iodine/iodine_pubsub.c', line 215
static VALUE close_subscription(VALUE self) {
iodine_subscription_s data = subscription_data(self);
if (!data.subscription)
return Qnil;
switch (data.type) {
case IODINE_PUBSUB_GLOBAL:
pubsub_unsubscribe((pubsub_sub_pt)data.subscription);
break;
case IODINE_PUBSUB_WEBSOCKET:
websocket_unsubscribe(data.owner, data.subscription);
break;
case IODINE_PUBSUB_SSE:
http_sse_unsubscribe(data.owner, data.subscription);
break;
}
rb_ivar_set(self, iodine_timeout_var_id, ULL2NUM(0));
return Qnil;
}
|
#to_s ⇒ Object
Returns the target stream / channel / pattern as a String object.
240 241 242 |
# File 'ext/iodine/iodine_pubsub.c', line 240 static VALUE subscription_to_s(VALUE self) { return rb_attr_get(self, to_str_shadow_id); } |