コード例 #1
0
ファイル: future.c プロジェクト: 3rf/mongo-c-driver
int64_t
future_get_int64_t (future_t *future)
{
   if (future_wait (future)) {
      return future_value_get_int64_t (&future->return_value);
   }

   fprintf (stderr, "%s timed out\n", BSON_FUNC);
   abort ();
}
コード例 #2
0
static void *
background_mongoc_client_kill_cursor (void *data)
{
   future_t *future = (future_t *) data;
   future_value_t return_value;

   return_value.type = future_value_void_type;

   mongoc_client_kill_cursor (
      future_value_get_mongoc_client_ptr (future_get_param (future, 0)),
      future_value_get_int64_t (future_get_param (future, 1)));

   future_resolve (future, return_value);

   return NULL;
}
コード例 #3
0
static void *
background_mongoc_gridfs_file_seek (void *data)
{
   future_t *future = (future_t *) data;
   future_value_t return_value;

   return_value.type = future_value_int_type;

   future_value_set_int (
      &return_value,
      mongoc_gridfs_file_seek (
         future_value_get_mongoc_gridfs_file_t_ptr (future_get_param (future, 0)),
         future_value_get_int64_t (future_get_param (future, 1)),
         future_value_get_int (future_get_param (future, 2))
      ));

   future_resolve (future, return_value);

   return NULL;
}
コード例 #4
0
static void *
background_mongoc_topology_select (void *data)
{
   future_t *future = (future_t *) data;
   future_value_t return_value;

   return_value.type = future_value_mongoc_server_description_ptr_type;

   future_value_set_mongoc_server_description_ptr (
      &return_value,
      mongoc_topology_select (
         future_value_get_mongoc_topology_ptr (future_get_param (future, 0)),
         future_value_get_mongoc_ss_optype_t (future_get_param (future, 1)),
         future_value_get_const_mongoc_read_prefs_ptr (future_get_param (future, 2)),
         future_value_get_int64_t (future_get_param (future, 3)),
         future_value_get_bson_error_ptr (future_get_param (future, 4))
      ));

   future_resolve (future, return_value);

   return NULL;
}