Skip to content

Commit

Permalink
Remove unused MessageLocalResult (#338)
Browse files Browse the repository at this point in the history
nit: remove unused mlr
  • Loading branch information
csegarragonz authored Jul 27, 2023
1 parent b7c6872 commit 74b12aa
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 52 deletions.
34 changes: 0 additions & 34 deletions include/faabric/scheduler/Scheduler.h
Original file line number Diff line number Diff line change
Expand Up @@ -171,40 +171,6 @@ class FunctionMigrationThread : public faabric::util::PeriodicBackgroundThread
void doWork() override;
};

/**
* A promise for a future message result with an associated eventfd for use with
* asio.
*/
class MessageLocalResult final
{
public:
std::promise<std::unique_ptr<faabric::Message>> promise;
int eventFd = -1;

MessageLocalResult();

MessageLocalResult(const MessageLocalResult&) = delete;

inline MessageLocalResult(MessageLocalResult&& other)
{
this->operator=(std::move(other));
}

MessageLocalResult& operator=(const MessageLocalResult&) = delete;

inline MessageLocalResult& operator=(MessageLocalResult&& other)
{
this->promise = std::move(other.promise);
this->eventFd = other.eventFd;
other.eventFd = -1;
return *this;
}

~MessageLocalResult();

void setValue(std::unique_ptr<faabric::Message>&& msg);
};

/**
* Background thread that periodically checks to see if any executors have
* become stale (i.e. not handled any requests in a given timeout). If any are
Expand Down
18 changes: 0 additions & 18 deletions src/scheduler/Scheduler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,24 +52,6 @@ static faabric::util::
ConcurrentMap<std::string, std::shared_ptr<faabric::planner::PlannerClient>>
plannerClient;

MessageLocalResult::MessageLocalResult()
{
eventFd = eventfd(0, EFD_CLOEXEC);
}

MessageLocalResult::~MessageLocalResult()
{
if (eventFd >= 0) {
close(eventFd);
}
}

void MessageLocalResult::setValue(std::unique_ptr<faabric::Message>&& msg)
{
this->promise.set_value(std::move(msg));
eventfd_write(this->eventFd, (eventfd_t)1);
}

Scheduler& getScheduler()
{
static Scheduler sch;
Expand Down

0 comments on commit 74b12aa

Please sign in to comment.