Mesos
view release on metacpan or search on metacpan
xsp/ExecutorDriver.xsp view on Meta::CPAN
#include <vector>
%name{Mesos::XS::ExecutorDriver} class mesos::perl::ExecutorDriver
{
%{
static void
_xs_init(SV* self, mesos::perl::MesosChannel* channel)
PPCODE:
if (SvROK(self) && SvTYPE(SvRV(self)) == SVt_PVHV) {
// make sure channel ref gets incremented
mesos::perl::ProxyExecutor* proxy = new mesos::perl::ProxyExecutor(channel->share());
mesos::perl::ExecutorDriver* driver = new mesos::perl::ExecutorDriver(proxy);
sv_magic(SvRV(self), Nullsv, PERL_MAGIC_ext,
(const char*) driver, 0);
}
%}
xsp/InterruptChannel.xsp view on Meta::CPAN
#include <string>
%name{Mesos::XS::InterruptChannel} class mesos::perl::InterruptChannel
{
%{
static void
DESTROY(SV* self)
PPCODE:
// make sure the c++ destructor only gets called once
// (both the blessed glob and the tied hash will call DESTROY)
if (!SvROK(self) || (SvTYPE(SvRV(self)) != SVt_PVGV))
XSRETURN_YES;
SV* glob = SvRV(self);
MAGIC *tie_magic = mg_find(MUTABLE_SV(GvIOp(glob)), PERL_MAGIC_tiedscalar);
SV* tied_hash = SvRV(tie_magic->mg_obj);
MAGIC* ext_magic = mg_find(tied_hash, PERL_MAGIC_ext);
mesos::perl::InterruptChannel* channel = (mesos::perl::InterruptChannel*) ext_magic->mg_ptr;
delete channel;
XSRETURN_YES;
static void
_xs_init(SV* self, void* interrupt_cb, void* interrupt_arg)
PPCODE:
if (SvROK(self) && SvTYPE(SvRV(self)) == SVt_PVHV) {
mesos::perl::InterruptChannel* channel = new mesos::perl::InterruptChannel((interrupt_cb_t) interrupt_cb, interrupt_arg);
sv_magic(SvRV(self), Nullsv, PERL_MAGIC_ext,
(const char*) channel, 0);
}
mesos::perl::MesosCommand
mesos::perl::InterruptChannel::recv()
CODE:
if (!THIS->size()) {
xsp/PipeChannel.xsp view on Meta::CPAN
#include <string>
%name{Mesos::XS::PipeChannel} class mesos::perl::PipeChannel
{
%{
static void
DESTROY(SV* self)
PPCODE:
// make sure the c++ destructor only gets called once
// (both the blessed glob and the tied hash will call DESTROY)
if (!SvROK(self) || (SvTYPE(SvRV(self)) != SVt_PVGV))
XSRETURN_YES;
SV* glob = SvRV(self);
MAGIC *tie_magic = mg_find(MUTABLE_SV(GvIOp(glob)), PERL_MAGIC_tiedscalar);
SV* tied_hash = SvRV(tie_magic->mg_obj);
MAGIC* ext_magic = mg_find(tied_hash, PERL_MAGIC_ext);
mesos::perl::PipeChannel* channel = (mesos::perl::PipeChannel*) ext_magic->mg_ptr;
delete channel;
XSRETURN_YES;
static void
_xs_init(SV* self, std::string type = "pipe")
PPCODE:
if (SvROK(self) && SvTYPE(SvRV(self)) == SVt_PVHV) {
mesos::perl::PipeChannel* channel = new mesos::perl::PipeChannel;
sv_magic(SvRV(self), Nullsv, PERL_MAGIC_ext,
(const char*) channel, 0);
}
mesos::perl::MesosCommand
mesos::perl::PipeChannel::recv()
CODE:
if (!THIS->size()) {
xsp/SchedulerDriver.xsp view on Meta::CPAN
#include <vector>
%name{Mesos::XS::SchedulerDriver} class mesos::perl::SchedulerDriver
{
%{
static void
_xs_init(SV* self, mesos::FrameworkInfo framework, std::string master, mesos::perl::MesosChannel* channel, ...)
PPCODE:
if (SvROK(self) && SvTYPE(SvRV(self)) == SVt_PVHV) {
mesos::perl::SchedulerDriver* driver;
// make sure channel ref gets incremented
mesos::perl::ProxyScheduler* proxy = new mesos::perl::ProxyScheduler(channel->share());
if (items > 4) {
mesos::Credential credential( toMsg<mesos::Credential>(ST(4)) );
driver = new mesos::perl::SchedulerDriver(framework, master, credential, proxy);
} else {
driver = new mesos::perl::SchedulerDriver(framework, master, proxy);
}
( run in 2.069 seconds using v1.01-cache-2.11-cpan-71847e10f99 )