Documentation ¶
Index ¶
- Constants
- func AddFile(f *project.File, k string) error
- func ChangeStatus(r *request.R) error
- func EndSubmission(id bson.ObjectId, k string) error
- func GetStatus() (*status.S, error)
- func H(m *MessageHandler)
- func NewSubmitter(rc chan *request.R) (*MessageHandler, *MessageHandler, error)
- func RedoSubmission(id bson.ObjectId) error
- func Reply(c *amqp.Channel, d amqp.Delivery, b []byte) error
- func SetAMQP_URI(uri string)
- func StartSubmission(id bson.ObjectId) (string, error)
- func StopProducers() error
- func WaitIdle() error
- type Changer
- type Consumer
- type Loader
- type MessageHandler
- func NewChanger(c chan *request.R) (*MessageHandler, error)
- func NewHandler(amqpURI, exchange, exchangeType, queue, ctag string, consumer Consumer, ...) (*MessageHandler, error)
- func NewLoader(c chan status.S) (*MessageHandler, error)
- func NewRedoer(rc chan *request.R) (*MessageHandler, error)
- func NewWaiter(c chan util.E) (*MessageHandler, error)
- type NewRequestHandler
- type NewStatusHandler
- type Producer
- type ReceiveProducer
- func IdleWaiter(amqpURI string) (*ReceiveProducer, error)
- func NewReceiveProducer(name, amqpURI, exchange, exchangeType, publishKey, bindingKey, ctag string) (*ReceiveProducer, error)
- func StartProducer(amqpURI string) (*ReceiveProducer, error)
- func StatusRetriever(amqpURI string) (*ReceiveProducer, error)
- type Redoer
- type Starter
- type Submitter
- type Waiter
Constants ¶
const ( DEFAULT_AMQP_URI = "amqp://guest:guest@localhost:5672/" LOG_AMQPWORKER = "processing/amqp_worker.go" WORKER_QUEUE = "worker_queue" SUB_START, SUB_END, SUB_REDO = "submission_start", "submission_end", "submission_redo" FILE, STATUS = "file", "status" SUCCESS, IDLE = "success", "wait_idle" ERR_ID, ERR_REQUEST, ERR_STATUS = "error_id", "error_request", "error_status" PREFETCH_COUNT = 3 PREFETCH_SIZE = 0 DIRECT = "direct" FANOUT = "fanout" )
const (
TASK_QUEUE = "task_queue"
)
Variables ¶
This section is empty.
Functions ¶
func ChangeStatus ¶
ChangeStatus is used to update Impendulo's current processing status.
func EndSubmission ¶
EndSubmission sends a message on AMQP that this submission has been completed by the user and can thus be closed when processing is done.
func H ¶
func H(m *MessageHandler)
func NewSubmitter ¶
func NewSubmitter(rc chan *request.R) (*MessageHandler, *MessageHandler, error)
func SetAMQP_URI ¶
func SetAMQP_URI(uri string)
Types ¶
type Changer ¶
type Changer struct {
// contains filtered or unexported fields
}
Changer is a Consumer which listens for updates to Impendulo's status and changes it accordingly.
type Loader ¶
type Loader struct {
// contains filtered or unexported fields
}
Loader is a Consumer which listens for status requests on AMQP and responds to them with Impendulo's current status.
type MessageHandler ¶
type MessageHandler struct { Consumer // contains filtered or unexported fields }
MessageHandler wraps a consumer in a struct in order to provide with other tools to manage its AMQP connection.
func NewChanger ¶
func NewChanger(c chan *request.R) (*MessageHandler, error)
func NewHandler ¶
func NewHandler(amqpURI, exchange, exchangeType, queue, ctag string, consumer Consumer, keys ...string) (*MessageHandler, error)
NewHandler
func (*MessageHandler) Handle ¶
func (m *MessageHandler) Handle() error
func (*MessageHandler) Shutdown ¶
func (m *MessageHandler) Shutdown() error
type NewRequestHandler ¶
type NewRequestHandler func(amqpURI string, requestChan chan *request.R) (*MessageHandler, error)
type NewStatusHandler ¶
type NewStatusHandler func(amqpURI string, statusChan chan status.S) (*MessageHandler, error)
type Producer ¶
type Producer struct {
// contains filtered or unexported fields
}
Producer is used to create new tasks which it publishes to the queue.
func FileProducer ¶
FileProducer
func NewProducer ¶
NewProducer
func StatusChanger ¶
StatusChanger creates a Producer which can update Impendulo's status.
type ReceiveProducer ¶
type ReceiveProducer struct { *Producer // contains filtered or unexported fields }
ReceiveProducer is used to create new tasks which it publishes to the queue. It also receives a response from the consumer which received its task.
func NewReceiveProducer ¶
func NewReceiveProducer(name, amqpURI, exchange, exchangeType, publishKey, bindingKey, ctag string) (*ReceiveProducer, error)
NewReceiveProducer
func StartProducer ¶
func StartProducer(amqpURI string) (*ReceiveProducer, error)
StartProducer creates a new Producer which is used to signal the start or end of a submission.
func StatusRetriever ¶
func StatusRetriever(amqpURI string) (*ReceiveProducer, error)
StatusRetriever
func (*ReceiveProducer) ReceiveProduce ¶
func (r *ReceiveProducer) ReceiveProduce(d []byte) ([]byte, error)
ReceiveProduce
type Redoer ¶
type Redoer struct {
// contains filtered or unexported fields
}
Redoer is a Consumer which listens for requests to reanalyse submissions and submits them for reanalysis.
type Starter ¶
type Starter struct {
// contains filtered or unexported fields
}
Starter is a Consumer used to connect a Submitter to a submission request.